What is angular?
Angularjs is a framework for developing dynamic Web applications. It allows you to use HTML as a template language and to make your application components clearer and more concise with extended HTML syntax. What makes it so innovative is that it reduces the amount of code through data binding and dependency injection, which is implemented via JavaScript on the browser side and is perfectly integrated with any server-side technology.
Angular is designed to extend the capabilities that HTML should have when building an application. For static documents, HTML is a good declarative language, but it can do nothing to build dynamic Web applications. Therefore, building dynamic Web applications often requires some skill to allow the browser to work with us.
In general, we address the problem of mismatches between dynamic and static documents in the following ways:
- Class Library-A collection of functions that are useful when developing Web applications. Your code plays a leading role and determines when to invoke the class library method. For example:
jQuery
and so on.
- Framework-a special implementation of Web applications, your code just needs to fill in some specific information. The framework plays a leading role and decides when to call your code. For example:
knockout
, and ember
so on.
Angular is trying to expand the structure of HTML to bridge the gap between document-centric HTML and the HTML needed for real-world Web applications. Angular extends the syntax of HTML through Directives (Directive). For example:
- By
{{}}
making data binding.
- Use the DOM control structure to iterate or hide dom fragments.
- Supports forms and forms validation.
- Associates the logical code to the DOM element.
- Make a set of HTML reusable components.
The important concept of angular
Concept |
Description |
Templates (Template) |
HTML with angular extension markup |
Directive (Directive) |
Used to extend the behavior of HTML through custom attributes and elements |
Models (model) |
data for displaying to users and interacting with the user |
Scope (SCOPE) |
The context used to store the model. The model is placed in this context to be accessed by controllers, directives, and expressions, etc. |
Expressions (expression) |
Variables and functions in scope (scope) can be accessed through the template |
Compiler (Compiler) |
Used to compile the template and instantiate the directives (Directive) and expressions (expression) contained therein |
Filters (Filter) |
The value that is responsible for formatting expressions (expression) for rendering to the user |
Views (view) |
What the user sees (that is, the DOM) |
DataBinding (data binding) |
Data and Views (view) representation in the auto-sync model |
Controllers (Controller) |
The business logic behind views (view) |
Dependency Injection (Dependency injection) |
Responsible for creating and automatically loading objects or functions |
Injection Device (Injector) |
Containers used to implement dependency injection (injection) |
Modules (module) |
Used to configure the injector |
Services (Service) |
View-independent, reusable business logic |
Article quoted from Http://docs.ngnice.com/guide
Angular JS Development Guide The first chapter Angular JS overview