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

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.

主站蜘蛛池模板: 黑河市| 嘉定区| 志丹县| 繁峙县| 沙洋县| 麻江县| 万载县| 阳江市| 茂名市| 三门峡市| 越西县| 改则县| 广宁县| 澄江县| 武定县| 黑水县| 郯城县| 旅游| 台北县| 肥东县| 五寨县| 北碚区| 鹰潭市| 八宿县| 宁乡县| 宝应县| 罗田县| 吐鲁番市| 策勒县| 沅江市| 阜南县| 英吉沙县| 康定县| 临洮县| 阳泉市| 台前县| 安国市| 闵行区| 楚雄市| 新田县| 吉木乃县|