Directive

An instruction attached to an element that changes how it looks or behaves.

What is Directive?

A directive is an instruction you attach to an element to change how it looks or behaves. Components are directives with a template; attribute directives like ngClass change an existing element.

<div [ngClass]="{ highlighted: isSelected }">...</div>

Level: Apprentice · More Angular terms at this level

Updated