User Name:


User Email:




This information will only be saved for the purposes of communicating with those who have provided this information voluntarily regarding our services.We will never sell your name or email address to anyone.
© 2018 - First Crazy Developer (Abhishek Kumar)
  

crazydeveloper Main Features of AngularJS

AngularJS is JavaScript Framework. It has predefined directives which help us to develope web application base on this framework. First we will describe the core directives of AngularJS which must need to develope application.

  1. ng-app :-  It is start point of AngularJS application. We defined this on start point and pass the module name with this.
  2. ng-init :-  It is use to initialize the data on application start.
  3. ng-controller :- It is use to coupled view with controller.
  4. ng-model :- It is use  to two way binding with $scope level variables with view. Generally it is use with input type like textbox, radion button, check box, select list etc.
  5. ng-bind :- It is use to one way binding with $scope level with view. Generally it is use with span to display content.
  6. ng-if :- It is use to create HTML DOM control on condition base.
  7. ng-switch :- It is also use to create HTML DOM control on condition base.
  8. ng-repeat :- It is use to create HTML DOM control  repeatlly with given array.
  9. ng-class :-  It is use to assign css class with control with normal or base of given condition.
  10. ng-style:- It is use to assign css style with HTML control.
  11. ng-click:- It is use to bind function event to fire on click on assign html controls.

These are main diretives which often use in AngularJS application and there are also lots ot other directive which help us to create application.

Sample code of above directives :-

ng-app="crazydeveloperApp" ng-init="countries=[{locale:'en-US',name:'United States'}, {locale:'en-GB',name:'United Kingdom'}, {locale:'en-FR',name:'France'}]">

  

ng-controller="Controller">

Enter your Name: type="text" ng-model="name">


 

Hello - ng-bind="name" ng-class="dispName">


       
ng-if="name=Abhishek">
            

You are author

       

ng-switch="country.name">
     
ng-switch-when="United States">
     

     

ng-switch-when="France">
     


Now we will know the main features of AngularJS :-

1. Modules
2. Directives
3. Templates
4. Scope
5. Expressions
6. Data Binding
7. MVC (Model, View & Controller)
8. Validations
9. Filters
10. Services
11. Routing
12. Dependency Injection
13. Testing


Now through below image we will understand the architecture of AngularJS


So what we undertood that core component of AngularJS is Module. The name of module we assign with ng-app, which is start point of AngularJS application.

All other components coupled with module so we can say that module is the point where we start application then defined other components which is tightly coupled with that module.

sample code :

var myApp=ng.module('myApp',[]);

myApp.config(function(){});

myApp.controller(function(){});

myApp.factory(function(){});

myApp.service(function(){});

myApp.provider(function(){});

myApp.directive(function(){});

myApp.filter(function(){});


crazydeveloper Home Page 20 May 2015

Become a Fan