The Wayback Machine - https://web.archive.org/web/20250617133914/https://angular.dev/api/core/outputBinding
    • Overview
@angular/core

outputBinding

function

Creates an output binding.

API

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

outputBinding

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
HTTPS · web.archive.org
← Home