AngularJS Overview : Learn to use Angular.js by adding behavior to your HTML and speeding up your application’s responsiveness. Get ready to dive into all the angles of Angular.js!
What Is AngularJS?
AngularJS is a structural framework for dynamic web apps. It is used in Single Page Application (SPA) projects with CRUD (Create, Read, Update and Delete) operations.
It extends HTML DOM with additional attributes and makes it more responsive to user actions.
AngularJS is open source, completely free, and used by thousands of developers around the world.
HTML is great for declaring static documents, but it falters when we try to use it for declaring dynamic views in web-applications.
AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.
- AngularJS is open source, completely free, and used by thousands of developers around the world.
Following diagram display some important parts of AngularJS
- Data Binding: Data-binding in Angular apps is the automatic synchronization of data between the model and view components.
- Providers: A provider is an object with a $get() method. The injector calls the $get method to create a new instance of a service.
- Validators: AngularJS forms and controls can validate input data.
- Directives: Directives are a way to teach HTML new tricks. During DOM compilation directives are matched against the HTML and executed.
- Modules: A module is a collection of services, directives, controllers, filters, and configuration information. angular. module is used to configure the $injector.
- Factories: A factory is a simple function which allows you to add some logic before creating the object. It returns the created object.
- Services: AngularJS come with several built-in services for example $http to make a XMLHttpRequests. These are singleton objects which are instantiated only once in app.
- Dependency Injection: AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test.
- Filters: These select a subset of items from an array and returns a new array.
- Scope: scope is an object that refers to the application model. Scopes can watch expressions and propagate events.
Advantages of AngularJS
- AngularJS code is unit testable.
- AngularJS provides reusable components.
- AngularJS provides capability to create Single Page Application in a very clean and maintainable way.
- AngularJS provides data binding capability to HTML thus giving user a rich and responsive experience
- AngularJS uses dependency injection and make use of separation of concerns.
- With AngularJS, developer write less code and get more functionality.
The AngularJS Components
The AngularJS framework can be divided into following three major parts:
- ng-app: This directive defines and links an AngularJS application to HTML.
- ng-model: This directive binds the values of AngularJS application data to HTML input controls.
- ng-bind: This directive binds the AngularJS Application data to HTML tags.