Directives in Angular

  • Directives are instructions in the dom.
  • When we place a directive in a html, we are directing angular, to display a template instead of the directive along with its business logic in our TypeScript code.
  • Types of directives in Angular are
    • Component Directive
    • Attribute Directive
    • Structural Directive
      • ngIf Directive
      • ngIf else directive
    • Form Directive
  • Some of the built in Angular directives are
    • ng-template
    • ngStyle directive
    • ngClass directive
    • ngFor directive

Leave a Comment