This article is Official HTML5 Training for h5edu institutions
angularjs expands html by a new attribute called Directive . angularjs adds functionality to your app with built-in instructions. angularjs allows you to customize the instructions. The angularjs Directive angularjs directive is an extended HTML attribute with the prefix ng-. The ng-app directive Initializes a AngularJS application. The ng-init instruction initializes the application data. The ng-model directive binds the element value (such as the value of the input field) to the application. The full instruction content can be found in the AngularJS reference manual. angularjs instance <div ng-app= "" ng-init= "Firstname= ' John '" > <p> try to enter:</p> in the input box <p> Name: <input type= "text" ng-model= "FirstName" ></p> <p> you entered as: {{ firstname }}</p></div>
Tutorial, Main introduction: JavaScript Intensive Tutorials --AngularJS directives
The Ng-app directive tells the angularjs,<div> element to be the "owner" of the AngularJS application. Note A Web page can contain multiple AngularJS applications that run in different elements. The {{firstName}} expression in the above instance of data binding is an AngularJS data-binding expression. Data binding in AngularJS, AngularJS expressions and AngularJS data are synchronized. {{FirstName}} is synchronized by ng-model= "FirstName". In the next instance, two text fields are synchronized with two Ng-model instructions: AngularJS instance <div ng-app= "ng-init=" quantity=1;price=5 ">
Click to enter JavaScript intensive tutorial
This article is from the "11721999" blog, please be sure to keep this source http://11731999.blog.51cto.com/11721999/1846679
JavaScript Intensive Tutorial--angularjs instructions