• Overview
@angular/core

outputBinding

function

Creates an output binding.

API

  
    function outputBinding<T>(  eventName: string,  listener: (event: T) => unknown): Binding;
  
  

outputBinding

Binding

Creates an output binding.

@parameventNamestring

Public name of the output to listen to.

@paramlistener(event: T) => unknown

Function to be called when the output emits.

Usage example

In this example we create an instance of the MyCheckbox component and listen to its onChange event.

          
interface CheckboxChange {value: string;}createComponent(MyCheckbox, {bindings: [outputBinding<CheckboxChange>('onChange', event => console.log(event.value))],});
@returnsBinding
Jump to details