GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Tutorials
  • Playground
  • Reference
  • code
  • DestroyRef
  • Lifecycle DestroyRef

This view

  • Original page
  • New address

GeezerVison is showing angular.dev — DestroyRef • Angular

API

    
      abstract class DestroyRef {}
    
    

Registers a destroy callback in a given lifecycle scope. Returns a cleanup function that can be invoked to unregister the callback.

@paramcallback() => void
@returns() => void
Usage notes

Example

const destroyRef = inject(DestroyRef);

// register a destroy callback
const unregisterFn = destroyRef.onDestroy(() => doSomethingOnDestroy());

// stop the destroy callback from executing if needed
unregisterFn();

Indicates whether the instance has already been destroyed.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.