ANGULARJS study notes--1. Getting Started

Source: Internet
Author: User

AngularJS is a JavaScript framework. It is a library written in JavaScript.

AngularJS is published as a JavaScript file and can be added to a Web page by a script tag: <script src= "Angular.js" ></script>

AngularJS extends HTML through instructions , and binds data to HTML through an expression .

AngularJS extends the HTML

AngularJS extends HTML through ng-directives .

The ng-app directive defines an AngularJS application.

The ng-model directive binds the element value (such as the value of the input field) to the application.

The ng-bind directive binds the application data to an HTML view.

Angularjs instances:

<!DOCTYPE HTML><HTML><Body>    <DivNg-app="">      <P>In the input box, try entering:</P>      <P>Name:<inputtype= "text"Ng-model= "Name"></P>      <PNg-bind= "Name"></P>    </Div>    <Scriptsrc= "Angular.js"></Script></Body></HTML>

Example Explanation:

When the page is loaded, AngularJS automatically opens.

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 study notes--1. Getting Started

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.