What Are Directives in Angular?

What Are Directives in Angular?

What Are Directives in Angular?

 

Types Of Directives in Angular?
  1. Structural Directive.
  2. Component Directive.
  3. Attribute Directive.
1. Structural Directive.

Structure directives manipulate the DOM elements. These directives have a * sign before the directive. For example, *ngIf and *ngFor.

Example: 

2. Component Directive.

Special directives in Angular are called Components since this type of directive has a template or template URLs. In effect, it is a component directive that shows something in DOM.

3. Attribute directive.

Attribute directive are used to change the look and behavior of the DOM elements. For example ngClass directive, ngStyle directive, etc.

 

Quiz App In Angular.                 Client Side PDF Generation In Angular With jsPDF.

Exit mobile version