官术网_书友最值得收藏!

  • Expert Angular
  • Mathieu Nayrolles Rajesh Gunasundaram Sridhar Rao
  • 111字
  • 2021-07-15 17:05:36

Local variables and bindings in templates

A template is a view that deals with the UI part of an application that is written in HTML. First we will see the syntax differences for One-way Data Binding.

AngularJS:

<h1>Book Details:</h1> 
<p>{{vm.bookName}}</p> 
<p>{{vm.authorName}}</p> 

Angular:

<h1>Book Details:</h1> 
<p>{{bookName}}</p> 
<p>{{authorName}}</p> 

Both the code snippets show the One-way Data Binding that binds the book and author name to the UI using the double-curly braces. However, the AngularJS prefixes with the alias of controller when referring the properties of the controller to bind to the template and Angular does not use prefixes with the alias, as the view or template is associated with the component by default.

主站蜘蛛池模板: 平远县| 齐河县| 彭水| 康定县| 北安市| 苍梧县| 布尔津县| 宜兰市| 旅游| 确山县| 甘南县| 筠连县| 诏安县| 监利县| 称多县| 孟州市| 南和县| 易门县| 丹阳市| 响水县| 祁阳县| 台南县| 于都县| 蒙自县| 丁青县| 北碚区| 本溪市| 微博| 新邵县| 加查县| 基隆市| 四子王旗| 连城县| 玉环县| 肃宁县| 荣成市| 商河县| 峡江县| 赤水市| 抚远县| 永春县|