Angular TutorialLesson 18Free preview
Angular Directives
This lesson is part of Angular · All levels
Summary
Directives are classes that change the appearance or behavior of DOM elements. Angular identifies three types: components, structural directives such as *ngIf and *ngFor that change layout, as well as attribute directives such as ngClass and ngStyle that change appearance. You can also create your own custom directives.
Key points
- Structural directives change the structure of DOMs such as *ngIf and *ngFor
- The directive attributes change appearances like ngClass and ngStyle
- Syntax * on structural directives simplifies writing
- Custom directives made with decorator @Directive
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.