Angular · Middle · Question 59 of 75
What does hostDirectives in a component or directive do?
@Component({
selector: 'app-menu-item',
hostDirectives: [CdkMenuItem],
})- ✓Correct answer: Applies other standalone directives to the host element, composing behavior without inheritance
- 2Lists directives that the template is allowed to use
- 3Moves the component into another host element
Explanation
Inputs and outputs of host directives are not exposed unless listed explicitly. It's the directive composition API.