Introduction


Directives in Angular

Directives are classes that extend the functionality of components in your Angular applications. You can handle forms, lists, styles, and what users view with Angular's built-in directives. Structural directives change the DOM layout by adding and removing DOM components.

  • Directives are classes that extend the functionality of components in your Angular applications. You can handle forms, lists, styles, and what users view with Angular's built-in directives.

The following are the many sorts of Angular directives:

  • Components are directives that are based on templates. This is the most frequent directive type.
  • Attribute directives change the appearance or behavior of an element, component, or another directive.
  • Structural directives change the DOM layout by adding and removing DOM components.

Directives are HTML properties that tell Angular how to change the look and feel of Dom elements.

When we say that directives are the building blocks of Angular apps, we mean that components are the building blocks.