Directives
Last updated
Last updated
TypeScript classes to manipulate DOM elements
Operate on existing elements
Don't have a template
Angular provides several directives: ngStyle, ngClass, ngModel
ng generate directive highlight
or ng g d highlight
If we wanted to highlight the text only when the user mouses over the element, then we would need to react to user events.
What are directives?
Creating custom directives
Handling user events
Passing inputs to directive