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.

OutputRef

A reference to an Angular output.

      
      interface OutputRef<T> {
subscribe(callback: (value: T) => void): OutputRefSubscription }

Child interfaces

Class implementations

Methods

Registers a callback that is invoked whenever the output emits a new value of type T.

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

OutputRefSubscription

Angular will automatically clean up the subscription when the directive/component of the output is destroyed.