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

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.

主站蜘蛛池模板: 桂东县| 秦安县| 新竹县| 仁化县| 东平县| 东阿县| 厦门市| 徐闻县| 陈巴尔虎旗| 金川县| 京山县| 阳西县| 璧山县| 安溪县| 务川| 大英县| 阜宁县| 姚安县| 东兰县| 福安市| 灌云县| 陆河县| 桃园县| 囊谦县| 濮阳县| 彰化市| 辽阳县| 乡城县| 康定县| 尼勒克县| 阳新县| 灌云县| 乳山市| 水城县| 藁城市| 龙游县| 灌南县| 青岛市| 墨脱县| 永清县| 汽车|