Home  >  Article  >  Web Front-end  >  Detailed examples of AngularJS expressions

Detailed examples of AngularJS expressions

零下一度
零下一度Original
2017-06-28 09:12:111673browse

Recently I want to make a cross-platform (pc\app\pad) thing to play with, and have studied many technologies:

android, ios, H5, Bootrap, angular, angular2, ApiCloud, WeChat applet

Except for the shackles (systems) of android and ios, everything else can be cross-platform. In particular, ApiCloud and WeChat applets are very popular for developing SDK-level solutions, but in terms of technical sovereignty, they are too dependent on others. Things,

H5 and bootstrap are very good in responsiveness, and the front-end and back-end frameworks can basically be contracted.

Of course there are many front-end frameworks such as vue.js and so on.

I don’t know why, but I am currently interested in Angular. Interest is the most shameless behavioral appeal. For example, you have a strong interest in a beautiful girl, and then. . . . (~~~Just kidding)

Then I have to find a way to get close to "her" ~~

I want to get close to angular ~~

Start by gathering information:

Where did she come from?

AngularJS[1] was born in 2009, created by Misko Hevery and others, and later acquired by Google. It is an excellent front-end JS framework that has been used in many Google products. AngularJS has many features, the most core of which are: MVC, modularization, automated two-way data binding, semantic tags, dependency injection, etc.

What’s so charming about her?

AngularJS is designed to overcome the shortcomings of HTML in building applications. HTML is a good declarative language for pseudo-static text display design, but it is weak when it comes to building WEB applications.

Usually, we use the following technologies to solve the shortcomings of static web page technology in building dynamic applications:
Class library - A class library is a collection of functions that can help you write WEB applications. . It's your code that takes control, and it's you who decides when to use the library. Class libraries include: jQuery and other
frameworks - A framework is a special, already implemented WEB application. You only need to fill it with specific business logic. The framework here plays a leading role, calling your code according to specific application logic. Frameworks include: knockout, sproutcore, etc.
------Okay, not charming enough
AngularJS provides developers with a higher level Abstractions to simplify application development. As with other abstraction techniques, some flexibility is lost. In other words, not all applications are suitable for AngularJS. The main concern of AngularJS is building CRUD applications. Fortunately, at least 90% of WEB applications are CRUD applications. But to understand what is suitable for building with AngularJS, you need to understand what is not suitable for building with AngularJS.
For example, games, graphical interface editors, applications with frequent and complex DOM operations are very different from CRUD applications, and they are not suitable to be built with AngularJS. In situations like this it might be better to use some lighter, simpler technology like jQuery.
------Are you excited?
----------I have to say that all our Internet behaviors are nothing more than CRUD on data points one by one, such as adding and subtracting items from the shopping cart (+ - ), check air tickets, tickets, clear WeChat friends who are not in contact, place an order----------
Further exploration:
In the tag, we use an ng-app identifier to indicate that this is an AngularJS application.
This ng-app identifier will cause AngularJS to automatically initialize your application.
We use the