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

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.

主站蜘蛛池模板: 玛沁县| 奇台县| 巴中市| 西华县| 会泽县| 平凉市| 新泰市| 青田县| 利津县| 黎川县| 柯坪县| 谢通门县| 和静县| 岑溪市| 濉溪县| 咸阳市| 邓州市| 凤城市| 台南县| 蒙阴县| 波密县| 张家港市| 元朗区| 通化县| 福州市| 从江县| 龙江县| 高淳县| 广州市| 阿合奇县| 桐柏县| 青河县| 桂东县| 政和县| 香河县| 垣曲县| 寿光市| 罗田县| 临清市| 龙南县| 图们市|