Understanding Angularjs and Angularjs simple and practical

Source: Internet
Author: User
Tags html header

In Angular.js, a specialized ViewModel (view model) is introduced to bond the view and model, allowing further separation and decoupling of the view and model.

1. Low coupling
2. reusability
3. Independent development
4. testability

Model View Controller
Data-page-Business processing
Views: pages for direct user action
Model: All data that participates in the operation (filtering, filtering, sorting, crud, etc.)
Control: Data transfer

Core function Modules of Angular.js
1, the data binding
2. Filter
3. Routing
4. Scope
5. Instruction Set
6. Templates
7. Dependency Injection

Using Angular.js

1 <!DOCTYPE HTML>2 <HTMLNg-app= "MYAPP"Ng-controller= "Myctrl">3 <!--4 Description: Introduction of ng-app= "MYAPP" ng-controller= "Myctrl" in the HTML header5  -6     <Head>7         <MetaCharSet= "Utf-8" />8         <title>Angular.js's instructions.</title>9     </Head>Ten     <Body> One         <Scriptsrc= "Js/angular.js"></Script> A         <Script> -             /* - * Introduce the following code in JS code to use Angular.js the              */ - Angular.module ("myApp ", []). Controller ("Myctrl ", function($scope) { -                 //The angular.js handler function "MYAPP" corresponds to the value of Ng-app; "Myctrl" corresponds to the value of Ng-controller; -             }); +         </Script> -     </Body> + </HTML>

Ng-app directive Initializes a AngularJS application.

Ng-controller directive is used to add a controller to your app.

Understanding Angularjs and Angularjs simple and practical

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.