Introduction to Directives
There are three types of directives in Angular you are going to work with:
- Components - also known as
Directives with Templates
, see Components chapter for a detailed overview; - Attribute Directives - extend elements, change the look and feel of the host elements;
- Structural Directives - change elements, manipulate DOM layout, add or remove elements or completely change underlying view;
Let's start with a new project to host various kinds of directives we are going to experiment with:
ng new directive-example
cd directive-example
ng serve --open