Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
Say hello to Angular's future home!Check out Angular.devHome
/

takeUntilDestroyed

Operator which completes the Observable when the calling context (component, directive, service, etc) is destroyed.

      
      takeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T>
    
Parameters
destroyRef DestroyRef

optionally, the DestroyRef representing the current context. This can be passed explicitly to use takeUntilDestroyed outside of an injection context. Otherwise, the current DestroyRef is injected.

Optional. Default is undefined.

Returns

MonoTypeOperatorFunction<T>