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

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.

主站蜘蛛池模板: 额济纳旗| 兰考县| 稷山县| 沙河市| 甘洛县| 三穗县| 渭南市| 弥渡县| 黔西县| 韩城市| 荆门市| 宁阳县| 收藏| 隆昌县| 宜阳县| 平谷区| 罗甸县| 罗定市| 奉贤区| 安远县| 镇巴县| 绩溪县| 涪陵区| 景宁| 邵武市| 富川| 青岛市| 安多县| 瑞金市| 红安县| 安康市| 望江县| 华蓥市| 准格尔旗| 乌拉特后旗| 梧州市| 玛曲县| 黑山县| 滁州市| 海城市| 洪洞县|