- 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.
推薦閱讀
- Practical Data Analysis Cookbook
- Web前端開(kāi)發(fā)技術(shù):HTML、CSS、JavaScript(第3版)
- Oracle 11g從入門到精通(第2版) (軟件開(kāi)發(fā)視頻大講堂)
- ThinkPHP 5實(shí)戰(zhàn)
- R語(yǔ)言數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南
- Learning Bayesian Models with R
- 區(qū)塊鏈:以太坊DApp開(kāi)發(fā)實(shí)戰(zhàn)
- 差分進(jìn)化算法及其高維多目標(biāo)優(yōu)化應(yīng)用
- Data Analysis with Stata
- PhpStorm Cookbook
- Getting Started with Python Data Analysis
- .NET 3.5編程
- Teaching with Google Classroom
- 批調(diào)度與網(wǎng)絡(luò)問(wèn)題的組合算法
- UVM實(shí)戰(zhàn)