What is AngularJs Directives?

What are Directives in AngularJs?

In Angularjs, The HTML attributes and binding controls are called directives.

All HTML attributes attached with prefix "ng-". The directives are

Basic Directives

  1. ng-app : this is used for initializes to application
  2. ng-init this is used for initialize to application data
  3. ng-model : this is used for binds HTML controls to application data
  4. ng-Controller : this is used for Attached a controller class to view.
Others then basic Directives
  1. ng-repeat : this is used for bind to repeated an HTML elements
  2. ng-if this is used for bind an HTML elements with condition
  3. ng-grid this is used for bind data collection to an HTML elements
  4. ng-show : this is used for Show the HTML elements
  5. ng-hide : this is used for Hide the HTML elements
  6. ng-class : this is used for CSS binding class
  7. ng-src : this is used for pass the URL image etc.
  8. ng-switch
  9. ng-bind etc.
Event Listener Directives
  1. ng-click : This is a click event to bind on HTML elements
  2. ng-dbl-click
  3. ng-mousedown
  4. ng-mouseup
  5. ng-mouseenter
  6. ng-mouseleave
  7. ng-mousemove
  8. ng-mouseover
  9. ng-keydown
  10. ng-keyup
  11. ng-keypress
  12. ng-change
Types of Directive
  1. Element directives
  2. Attribute directives
  3. CSS class directives
  4. Comment directives

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog - https://www.code-sample.com/
My Books - Book 1 and Book 2

www.code-sample.com/. Powered by Blogger.