Saturday, 22 December 2018

What is AngularJS

What is AngularJS?
AngularJS is JavaScript open source framework was developed in 2009 by Misko Hevery and Adam Abrons. Now it is maintained by Google. It is used to build web applications and essay to use, modify and sharable. It is very powerful framework that helps to create Single Page Applications (SPA), MVC pattern applications. It is also useful to develop dynamic web apps.

AngularJS supports to Model-View-Whatever (MV**, **whatever you want to do)

What are AngularJS Features?

AngularJS Controllers

It is responsible to control the data or in other word, AngularJS controller is used to manage the flow of data of AngularJS application. ng-controller directive define the controller class to view. Attributes/properties and functions can be define in a controller. AngularJS invokes the controller with a $scope object.

Use controllers to:

1:- Set up the initial state of the $scope object.
2:- Add behaviour to the $scope object.

Do not use controllers to:

1:- Manipulate DOM
2:- Format input
3:- Filter output
4:- Share code or state across controllers

AngularJS Directives

Directives are attributes starting with ng- prefix that provide the way to you to extend the HTML with new attributes called Directives.
AngularJS provides lot of build-in directives that can be used to extend the html. You can also create your own (custom) directives.

Following are the most common directives:

ng-app: This directive starts an AngularJS Application.
ng-init: This directive initializes application data.
ng-model: This directive defines the model that is variable to be used in AngularJS.

AngularJS Expressions

AngularJS Expressions are used to bind data to view (HTML) that can be written inside double braces: {{expression}}

AngularJS Data Binding

AngularJS provides way to bind the model to view and vice versa. It works like bridge between the model and the view. It support two-way binding means if data changes in model, the data on the view also reflects with the changes, Also if data in the view changes, the model data will updated immediately and automatically .

AngularJS Module

AngularJS Module is container that contains the different parts of your application like filters, controllers, directives, services, etc. that lets you, how an application should be bootstrapped. Any library should be specifying in the module that you want to use.

AngularJS Scope ($scope)

Scope is an object that refers to the application to binding between the HTML and controller. The application can have multiple scopes, because directives can create new child scopes. When new scopes are created, they are added as children of their parent scope.

Root Scope ($rootScope)

There will be a single root scope in application. All other scopes is created in application is sub scopes of the root scope. Scopes provide separation between the view and the model.

AngularJS Filters

AngularJS Filters is used to format the value for display to the end users. It can be used in services, view templates or controllers. By using pipe (|) character, you can add angular filters.
AngularJS provides below list of built-in filters

Selects a subset of items from array and returns it as a new array.
Formats a number as a currency.
Formats a number as text.
Formats date to a string based on the requested format.
Allows you to convert a JavaScript object into JSON string.
Converts string to lowercase.
Converts string to uppercase.
Creates a new array or string containing only a specified number of elements.
Orders an array by an expression


  1. Thank you so much for sharing this pretty website, it was so good to read and useful to improve my knowledge as


Note: only a member of this blog may post a comment.