Angular directives allow the creation of DOM elements. We can also change the structure and behavior of the elements. There are three types of Angular directives…
- Components – directives that have templates.
- Attribute – directives that change appearance and behavior or elements.
- Structural – directives that change the DOM layout.
The difference between a component and a directive is the template. Components have a template. Attribute and structural directives do not. Angular does come with built-in directives such as *ngFor and *ngIf, which are structural, and NgStyle and NgModel, which are attribute.