Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

OutputEmitterRef

An OutputEmitterRef is created by the output() function and can be used to emit values to consumers of your directive or component.

See more...

      
      class OutputEmitterRef<T> implements OutputRef<T> {
  constructor()
subscribe(callback: (value: T) => void): OutputRefSubscription
emit(value: T): void }

Description

Consumers of your directive/component can bind to the output and subscribe to changes via the bound event syntax. For example:

      
      <my-comp (valueChange)="processNewValue($event)" />
    

Constructor

      
      constructor()
    
Parameters

There are no parameters.

Methods

      
      subscribe(callback: (value: T) => void): OutputRefSubscription
    
Parameters
callback (value: T) => void
Returns

OutputRefSubscription

Emits a new value to the output.

      
      emit(value: T): void
    
Parameters
value T
Returns

void