Directives

In this lesson, we will look at directives, some commonly used directives, and how we can create custom attribute directives.

`intro-directives

A directive is used when you wish to extend the behavior of any HTML element. It helps us add or extend the behavior of any element in terms of its layout, appearance, etc. In the previous lesson, we created a component directive. A component is also a type of directive, but it has a template of its own.

Directives work the same way we use selectors to reference components.

Angular has the following different types of directives:

  • Component directives, which we have already seen.
  • Attribute
...