AngularJs Study Notes

Source: Internet
Author: User

Ng-app= "" Defines the scope of use of the Angularjs

eg

ng-model= "Variable" defines the variable name

eg

Ng-init instruction initialization ANGULARJS Application variable

eg

The ng-bind directive binds a variable to the innerhtml of a paragraph

eg

The ng-repeat instruction repeats an HTML element

eg

Output the values in the names array sequentially

The ng-disabled directive binds the application data directly to the disabled property of the HTML

Ng-show instruction hides or displays an HTML element ng-show=ture as visible ng-show=false for invisible

The Ng-click directive defines ANGULARJS click events

AngularJs expression written in double curly braces {{expression}}

eg

Output Results 10

By adding the Restrict property and setting the value "A" to set the instruction to invoke only through the property's way

eg

There are four types of restrictde values

E uses a as the element name as a property using C as the class name using m as the comment

Ng-controller= "Myctrl" is used to define a controller

Bidirectional binding When you modify the value of an input field, the value of the Angularjs property is also modified

eg

AngularJs filters can be added to expressions and directives using the pipe character (|)

Eg:currency formatting numbers as currency formats

Scope (scope) is the application of the link between HTML and JS for a property that has methods and properties available

$scope can be passed as a parameter

eg

$rootScope root scopes can function in all HTML elements contained in the NG-APP directive

ANGULARJS Service

$location service can return the URL address of the current page

$http Service service sends a request to the server to apply the data sent by the response server.

eg

The Window.settimeout function of $timeout function corresponding to JS

Create a selection box using Ng-options

eg

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.