December 2017
Beginner
372 pages
10h 32m
English
Angular calls the onDestroy event when it's about to destroy the component. This is a good place to have a logic for cleaning up our resources, stop any timers or actions happening automatically, and clean up the memory.
Sometimes, we also use this event to let the other components or other parts of the application know that the component is being destroyed, and they may want to update or perform some specific action, as required by the business logic.
Read now
Unlock full access