Coding task · Angular course · Module 14: Advanced Patterns

Practice: Attribute Directive

An attribute directive changes the look or behavior of an element and has its own decorator with an attribute selector (not @Component, since it has no template). ElementRef gives access to the DOM, a method decorator listens to events of the element the directive sits on, and @HostBinding binds its properties.

Task

Complete the highlight directive that changes the background on hover.