- 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.
推薦閱讀
- OpenShift開發指南(原書第2版)
- Processing互動編程藝術
- Visual Basic程序設計習題解答與上機指導
- Mastering Python Networking
- Drupal 8 Module Development
- JavaScript入門經典
- Building Serverless Applications with Python
- Python數據結構與算法(視頻教學版)
- Building Machine Learning Systems with Python(Second Edition)
- C# and .NET Core Test Driven Development
- 軟件工程基礎與實訓教程
- Python硬件編程實戰
- Learning Shiny
- Visual FoxPro程序設計習題及實驗指導
- 零基礎學Java(第5版)