What is AngularJS? AngularJS introduction _ AngularJS

Source: Internet
Author: User
This article mainly introduces what is AngularJS? AngularJS is an introduction to AngularJS, which is a framework designed for Dynamic WEB applications. It allows you to use HTML as the template language. by extending the HTML syntax, you can build your application components more clearly and concisely. For more information, see What is AngularJS?

AngularJS is a structure framework designed for Dynamic WEB applications. It allows you to use HTML as the template language. by extending the HTML syntax, you can build your application components more clearly and concisely. Its innovation lies in the use of data binding and dependency injection, which frees you from writing a lot of code. All of these are implemented through Javascript on the browser, which makes it perfectly integrated with any server-side technology.

AngularJS is designed to overcome the shortcomings of HTML in building applications. HTML is a well-designed declarative language for static text display, but it seems weak to build WEB applications. So I did some work (you can also think it is a little trick) to let the browser do what I want. FormatDate

Generally, the following technologies are used to solve the shortcomings of static Web pages in building dynamic applications:

1. The class library-class library is a collection of functions that can help you write WEB applications. Your code determines when to use the class library. Class Libraries: jQuery

2. Framework-framework is a special and implemented WEB application. You only need to fill in the specific business logic for it. Here, the framework plays a leading role in calling your code based on the specific application logic. The frameworks include knockout and sproutcore.

AngularJS uses different methods, which try to supplement the defects of HTML in application construction. AngularJS uses a structure called direves ves to enable the browser to recognize New syntaxes. For example:

1. Bind data using double braces;
2. Use the DOM control structure to iterate or hide DOM fragments;
3. Support form and form verification;
4. The logic code can be associated with related DOM elements;
5. HTML can be grouped into reusable components.

End-to-end solution

AngularJS tries to become an end-to-end solution for WEB applications. This means that it is not only a small part of your WEB application, but a complete end-to-end solution. This will make AngularJS very stubborn when building a CRUD (add Create, query Retrieve, Update, Delete) application (the original article is opinionated, it means there are not many other methods ). However, despite its stubbornness, it can still ensure that its stubbornness is only at the beginning of your application construction, and you can still flexibly change it. AngularJS has the following advantages:

1. All the content that may be used to build a CRUD application includes data binding, basic template identifier, form verification, routing, deep link, Component reuse, and dependency injection.
2. Testing involves unit testing, end-to-end testing, simulation, and automated testing frameworks.
3. The seed application with directory layout and test script as the starting point.

AngularJS cute

AngularJS simplifies application development by presenting a higher level of abstraction to developers. Like other abstract technologies, this will also lose some flexibility. In other words, not all applications are suitable for using AngularJS. AngularJS mainly considers building CRUD applications. Fortunately, at least 90% of WEB applications are CRUD applications. But to understand what is suitable for building with AngularJS, you must understand what is not suitable for building with AngularJS.

Such as games and graphic interface editors. DOM operations are frequently and complex, which are very different from CRUD applications. They are not suitable for AngularJS construction. In this case, it may be better to use lighter and simple technologies such as jQuery.

A simple AngularJS instance

The following is a typical CRUD application that contains a form. The form value is verified first and then used to calculate the total value. This value is formatted as a cost-effective style. The following are some common concepts for developers. You need to understand them first:

1. Associate the data model with the view (UI;
2. write, read, and verify user input;
3. Calculate New values based on the model;
4. localized the output format.

Index.html:

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.