Question: What is the HostBinding decorator doing in this directive?
- It is adding the CSS class named highlighted to any DOM element that has the appHighlight directive on it.
- HostBinding does not do anything on directives, only on components.
- It is specifying if the host element gets the highlighted class added to its class attribute, then the directive class field highlight will get set to true; and if it is not added on the host it will get set to false.
- It is creating an inline style on the host element with a CSS property named highlight set to true.
Answer: The correct answer of the above question is Option A:It is adding the CSS class named highlighted to any DOM element that has the appHighlight directive on it.