0Pricing
Angular Academy · Lesson

Exposing Inputs and Outputs

Surface host directive inputs and outputs.

Exposing Composed APIs

When you compose a directive via hostDirectives, its inputs and outputs are hidden by default. The composition API lets you expose selected inputs and outputs to the host's public API.

The Object Form

Instead of listing just the class, use an object with directive, inputs, and outputs arrays.

hostDirectives: [{
  directive: TooltipDirective,
  inputs: ['tooltipText'],
  outputs: ['tooltipShown']
}]

All lessons in this course

  1. The hostDirectives Property
  2. Exposing Inputs and Outputs
  3. Building Reusable Behaviors
  4. Composition vs Inheritance
← Back to Angular Academy