The method ______ is called just before Angular destroys the component.

  • ngAfterViewInit
  • ngOnChanges
  • ngOnDestroy
  • ngOnInit
The method ngOnDestroy is called just before Angular destroys a component. Developers can use this method to perform cleanup tasks, such as unsubscribing from observables, releasing resources, or canceling ongoing operations, before the component is removed from the DOM. It's a crucial part of component lifecycle management in Angular.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *