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 creates a new instance.
Application is not created through angular CLI. It's a custom build application using the webpack configuration provided on angular website. Actually, I am doing performance improvement of the existing angular application and this demo app I created for isolation of issue.
Github https://github.com/bytesofdhiren/angular-memory-issue
Basically, every time I route to home or register page, the application creates a new instance of the register component and home component. It's not destroying the earlier created component.