Introducing directives
Angular directives are HTML attributes that extend the behavior or the appearance of a standard HTML element. When we apply a directive to an HTML element or even an Angular component, we can add custom behavior to it or alter its appearance. There are three types of directives:
- Components are directives with an associated template.
- Structural directives add or remove elements from the DOM.
- Attribute directives modify the appearance or define a custom behavior of a DOM element.
Angular provides us with a set of built-in directives that we can use in our components and cover most use cases.