Directives allows us to extend the behavior of the elements. We can manipulate the Document Object Model (DOM) of a HTML page using the different types of directive definitions.
Angular uses the @Directive metadata to tell the application about the type of directives they have and the functional capabilities defined with each directive.
The following diagram shows the different types of directives:
There are mainly three types of Angular Directives:
- Component Directives: We can define these as user-defined directives, similar to custom directives in Angular 1.x
- Structural Directives: Directives that alter or transform the DOM elements (one or more) on the fly
- Attribute Directives: Directives that extend the behavior or look and feel of an element
In Angular 1.x, we had the A (Attribute), E (Element), C (Class), M (Matches comment) directives.
Angular comes...