I have one component Details where the routes for other child components is there. What is happening is that when I route to any other child component then the onint of the Details is getting called.
For Example- example.com/details/123123123/profile is my current route
I am navigating to example.com/details/12312331/pastappointment
then the NgOnInit of Details is getting called. Which is calling all the apis that I don't want.
You have to use
<router-outlet></router-outlet>
inside your Details component.