Two-way binding
When your business has reached a certain scale, the data changes to the view display is not a simple two-way binding can hold, your view updated you may not even know where the data changes caused.
Give you another angle to manipulate the DOM.
Simplifies your writing of DOM operations, and you don't see those each,append. And you have a clear logical world.
Avoid a lot of JavaScript operation DOM, this can make the code clear, more convenient maintenance.
Angular more suitable for crud Development of management systems
Angular is suitable for forms, and all MVVM is suitable for making forms. Then large mvvm, such as angular, will provide a series of support for the form-related.
Search engines can only get a template, but no content.
Need SEO. (SEO now also has the PreRender solution) Https//prerender.io.
Modular programming can be tested
This train of thought has two points, 1) Modular 2) can be tested.
The future trend is: Background program no longer do any template processing
The future trend is that the front-end backend relies only on JSON data for communication: The backend only processes and sends a piece of JSON data to the front end, and then the compute and template rendering is done at the front end. After the front-end changes, the JSON data is formed and then passed back to the backend. The future trend is: The background program no longer do any template processing.
Angular is in line with the trend of development, first, decoupling the front end, second, can be modular, the third can be tested, the fourth natural support json, v Dependency Injection and so on, There are other features that allow angular to follow and even push the front-end development trend.
The ANGULARJS itself is a good front-end templating engine, and the future development is that the back-end MVC produces a JSON view as the front-end model, whereas the entire front-end MVC is the back-end view, and the intermediate communication relies on JSON. The high decoupling of the front and rear ends can fully meet the requirements of the modular design.
Google
With Google's strong support and growing popularity, the company began to use angular, some jobs need to have angular knowledge to work.
Angularjs2
ANGULARJS2 is angularjs1.x's mvvm+componet system.
What is the structure of a complete project?
Any NG application consists of a limited number of module types, such as controllers, directives, services, routes, filters, and so on.
Using a total app module as the entry point, it relies on all other modules.
App
|--css
|--imgs
|--lib
|--js
|--app.js as the starting point JS
|--controllers.js controller encapsulates business logic with controller
|--directives.js directives encapsulate DOM operations with directives
|--filters.js Filter conversion Output with filter
|--services.js Service encapsulates reusable code with services
|--routes.js Front-end routing
|--tpls->templates Template hello.html
|--index.html app's main HTML file
My understanding of the ANGULARJS framework