In angular application, every time I route to a new page, my earlier page\'s component is staying in memory. It\'s not getting destroyed and when I route back to that page it cr
Every component has a lifecycle you need to use:
OnDestroy();
and you need to implements the method ngOnDestroy(). Follow this
ngOnDestroy()