AngularJS was originally developed by Misko Hevery and Adam Abrons A personal project developed in his spare time in 2009. The original project name was GetAngular. The design goal was to allow web designers (non-developers) to create simple applications using only HTML tags. Over time, AngularJS evolved into a comprehensive development framework. In 2010, in order to promote the development speed of Google Feedback and the progress of the project, Misko Hevery reconstructed Google Feedbac based on GWT, compressing the original more than 17,000 lines of code to only more than 1,500 lines. Since then, Angularjs has attracted attention, and AngularJS has transformed into Google company projects. Angular1.0 introduces the concept of two-way data binding. In 2016, Microsoft and Google cooperated and adopted TypeScript as a new development language and released Angular 2.0. Angular2.0 and Angularjs1.x are completely different architectures. Angular2.0 and later versions are collectively called Angular2. The user group of Angular1.x is also relatively large, and the corresponding version framework continues to be maintained. The latest version is 1.8.2. The latest version of Angular2 is 11.0.0.
2. Development overview
##2.1 Two-way data binding In conventional front-end development, data and views are often related through single binding. The advantage of this model is that the results are relatively simple. The model is responsible for updating data and rendering combined with the template, and the view layer is only responsible for display. The disadvantage of this structure is that data changes in the view layer cannot be fed back to the model layer, which cannot meet the needs of highly interactive pages. This is when two-way data binding comes into being.
Any native Events will not trigger dirty checks, you must call <span class="katex--inline"><span class="katex"><span class="katex-html"><span class="base"><span class="mord mathdefault">s</span><span class="mord mathdefault">c</span><span class="mord mathdefault">o</span><span class="mord mathdefault">p </span><span class="mord mathdefault">e</span><span class="mord">.</span></span></span></span></span>applyNotify angular to update the UI.
Angular2 has Zone.js. Natively, setTimeout, addEventListener, promise, etc. are all executed in ngZone. Angular has set up corresponding hooks in ngZone, notifies angular2 to do the corresponding dirty check processing, and then updates the DOM.
3. Basic concepts
Module
Component
Template
Metadata
Data Binding
Directive
Service
Dependency Injection (dependency injection)
3.1 Module (module)
Application modularization
Module It is a code block with tight functions and has at least one root module NgModule (AppModule)
The component controls a small area on the screen called the view
Define the application logic of the component in a class (mainly used to support the view). Classes and views interact through an API of properties and methods
Performs the creation, update, and destruction of components through life cycle hooks
The above is the detailed content of This article will give you an in-depth understanding of Angular11. For more information, please follow other related articles on the PHP Chinese website!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn