AngularJS getting started tutorial (2): AngularJS template _ AngularJS

Source: Internet
Author: User
This article mainly introduces AngularJS getting started tutorial (2): AngularJS template. This is the third article in the series. This series will use a project to explain how to use AngularJS, for more information about the dynamic features of these webpages, see AngularJS! Here we have added a test for the Controller to be added later.

There are many types of code architectures for an application. For AngularJS applications, we encourage you to use the Model-View-controller (MVC) mode to decouple code and separate concerns. With this in mind, AngularJS is used to add models, views, and controllers for our applications.

Reset the working directory:

The Code is as follows:


Git checkout-f step-2

Our application now has a list of three mobile phones.

The most important differences between steps 1 and 2 are listed below. You can go to GitHub to see the complete difference.

Views and templates

In AngularJS, a view is the ing after the model is rendered using the HTML ** template. This means that, no matter when the model changes, AngularJS will update the combination point in real time and update the view accordingly.

For example, the view component is constructed by AngularJS using the following template:

The Code is as follows:




...

Related Article

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.