ANGULARJS Study Notes--

Source: Internet
Author: User

<span ng-bind= "Name" ></span>
<span ng:bind= "Name" ></span>
<span ng_bind= "Name" ></span>
<span data-ng-bind= "Name" ></span>
<span x-ng-bind= "Name" ></span>

Ps: The above binding method is equivalent

ng-app= "Module name" defines the scope of use of angularjs;

ng-init= "variable = value", initialize the value of the variable, when there are multiple variables, the middle is separated by semicolons;

ng-model= "Variable" defines the variable name;

ng-bind= "Variable" binds the variable name to get the data for the variable. The variables here are the variable names of the previous bar. However, it is common to use double curly braces to get the value of a variable.

<div ng-app= "" > <p> Name: <input type= "text" ng-model= "name"/></p> 

The Ng-app directive tells the angularjs,<div> element to be the owner of the Angularjs application; The Ng-model directive binds the value of the input field to the application variable name The ng-bind directive binds the application variable name to the innerHTML of a paragraph.

Angularjs is easier for developing single-page applications: ANGULARJS binding Application Data to HTML elements, cloning and full HTML code, the ability to hide and display HTML elements, the ability to add code behind HTML elements, and support for input validation.

<div ng-app= "" ng-init= "Firstname= ' Jonh '" > <p> name: <span ng-bind= "FirstName" ></span></p >  </div>

H5 allows extended properties to start with data-, Angularjs properties start with ng-, but you can use data-ng-to make the page valid for H5.

<div ng-app= "" data-ng-init= "Firstname= ' Jonh '" > <p> name: <span data-ng-bind= "FirstName" ></span ></p>  </div>

Angularjs expression:

The ANGULARJS expression is written in double curly braces; the ANGULARJS expression binds the data to HTML, similar to the Ng-bind directive; Angularjs outputs the data where the expression is written.

The Angularjs module defines the application of the ANGULARJS, the ANGULARJS controller is used to control the ANGULARJS application, the ng-app instruction is applied, and the controller is defined with Ng-controller.

To be Continued ...

Reference & Thanks: http://www.runoob.com/angularjs/angularjs-intro.html

ANGULARJS Study Notes--

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.