> For the complete documentation index, see [llms.txt](https://bharat-tiwari.gitbook.io/our-tech-journal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bharat-tiwari.gitbook.io/our-tech-journal/angular-4/custom-directives.md).

# Custom Directives

In Angular, there are three types of directives

* components
* structural directives
* attribute directives

A component is actually a Angular directive having a view attached to it.

A structural directive is used to define a DOM behavior like adding or removing elements from DOM examples are - ngIf, ngFor and ngSwitch

An attribute directives is used to give a styling behavior to the elements. examples are ngClass, ngStyle
