Directives can be attributes, tags, or even class names.
Once you write them in your HTML markup, it will be picked up by angular and will act as you defined it.
It gives you the ability to define new custom HTML elements, for example, or new behavior attributes such as
<div angry></div>
And every time someone clicks on this div, he receives and warns: "I'm angry."
Basically, you can make any extension necessary to make your html as clear and understandable as possible. it all depends on how you define the directive.
source share