Home >>Angular8 Tutorial >Angular8 Directives
The DOM is manipulated through the Angular 8 directives. You may change the appearance, behavior or layout of a DOM element by using the Angular directives. It helps to expand HTML, too.
Angular 8 directives can be classified into 3 categories according to their behaviour:
Component Directives: Component directives are used in main class. They contain the detail of how the component should be processed, instantiated and used at runtime.
Structural Directives: Structural guidelines begin with a * sign. These directives are used to modify and change the DOM entity structure. For example, directory * ngIf, directive * ngSwitch, and directive * ngFor.
* ngIf Directive: ngIf lets us add / remove DOM Element.
* ngSwitch: * ngSwitch enables us to add / remove DOM elements. It is identical to the C # switch statement.
* ngFor Directive: * ngFor directive is used to repeat a portion of the HTML template from an iterable list (Collection) once per object.
Attribute Directives: Attribute Directives are used to alter the DOM elements look and actions. For example: directive ngClass, and directive ngStyle etc.