AngularJS Directives

AngularJS directives are markers on HTML DOM elements (like attribute, element name). AngularJS will comes with set of built-in directives, below are the few of them.

  • ngApp : Used as root element of the application
  • ngController : Used to attach controller class to the view
  • ngModel : Used to bind variables or application data to HTML controls input,select, textarea
  • ngInit : Used to initialize the variables and application data
  • ngBind : Used to assign text to HTML elements
  • ngRepeat : Used to repeat the elements based on a collection
  • ngShow/ngHide : Used to show or hide the HTML element
  • ngStyle : Used to set CSS style to an element
  • ngClass : Used to dynamically set CSS classes
In our next articles we will discuss about the above directives with examples.