Angular MVC Learning

Source: Internet
Author: User

The MVC pattern is, model (M)-View (V)-Control (C).

First, view (V)

The template section corresponds to the view (V) in the angular. The template is usually a view of the HTML + CSS constructs used to represent the view of the app. Use basic HTML and CSS, add angular compiler directives or tags, or you can customize some angular tags to form a view of the template for your app.

Ii. Control (C)

Application logic and Behavior (Behavior), is a series of controllers generated with JS, through the controller to modify the values associated with the view, directly to the view level, which is the angular of the two-way binding mechanism. We do not need to add additional listeners or DOM controllers, such as Ajax, to show the logic well. For example, we use a similar binding method such as Jquery+lodash, we are bound to add a listener, and then use the $.get method to obtain the template content, and then use Ajax to obtain the model data, through the template function, the obtained data binding model, Then put it in an HTML DOM and use angular we don't need this series of operations.

Iii. Model (M)

ANGULARJS maintains a bidirectional synchronization of the data model and the view interface UI through scopes. Once the model state changes, ANGULARJS is immediately refreshed and reflected in the view interface, and vice versa. This part of the two-way binding real mechanism continues to understand, later again introduced.

Take a note and learn some of angular's insights.

Angular MVC Learning

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.