The Basics of Directives in Angular
Directives provide a variety of ways to abstract the HTML UI elements, attributes, classes, expressions and styles. There are tons of use cases in Angular for Directives which are described as follows:
- Directives for styles
- Built-in Directives
There are many built-in directives in Angular. The frequently used ones are *ngIf
and *ngFor
.
The *ngIf
is used for conditional expressions.
The *ngFor
is used for loops.