Angular Directives

There are mainly two types of directives as below –

Structural Directives

Structural Directives are used for manipulating the DOM elements. You will find an asterisk (*) prefix before the directive. We can take*ngFor and *ngIf as examples here.

Attribute Directives

When it comes to altering the behavior and look of the DOM element, you turn to attribute directives.

  • ngIf
  • ngSwitchCase
  • ngFor
  • ngStyle
  • ngClass

Leave a Comment

Close Bitnami banner