Angular · Middle · Question 59 of 75

What does hostDirectives in a component or directive do?

@Component({
  selector: 'app-menu-item',
  hostDirectives: [CdkMenuItem],
})

Explanation

Inputs and outputs of host directives are not exposed unless listed explicitly. It's the directive composition API.

Further reading

Problem with a question

Angular · Middle · question 59

Test yourself

Take the Angular · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz