Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (19.9k points)

I have 3 Components A, B, and C in my angular project. I have used default routing

''' '''

I am navigating from A-> B -> C and C is my result page. What I observed is even though I am at C, component A is still running in the background. How to kill A here?

1 Answer

0 votes
by (25.1k points)
edited by

Your component should implement the OnDestroy interface, than inside ngOnDestroy you may want to unsubscribe observables.

Want to become an expert in bootstrap and angular? Then check out the Angular certification course from Intellipaat which is a 24hrs online instructor-led training with 48hrs for projects and exercises to help you improve the hands-on experience.

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...