What is the meaning of Directive in Angular Js? List some of them.

 Posted by Chvrsri on 3/28/2016 | Category: AngularJS Interview questions | Views: 593 | Points: 40
Answer:

As the name suggests Directives are the ones which shows the direction on how the DOM elements to behave.

Directives are the markers on the DOM element just like an attribute like element name or Css Class which tells the Angular Js HTML compiler to add a specified behavior to the respective DOM element via event listeners which are available.

Some of the Directives are:

ng-app : It Initializes application.
ng-model : It Binds the HTML controls to application data.
ng-Controller : It Attaches a controller class to view.
ng-repeat : It Binds repeated HTML data elements. This is more or less like a for Loop
ng-if : It Binds HTML elements with a condition.
ng-show : It used to show the HTML elements.
ng-hide : It used to hide the HTML elements.
ng-class : It used to assign CSS class.
ng-src : It used to pass the URL image.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response