concept programmatic routing in category angular
appears as: programmatic routing

This is an excerpt from Manning's book Angular in Action.
The router service provides a
navigatemethod that takes the exact same syntax asrouterLink. In this case, we’re declaring that the chat outlet should navigate to null, which tells Angular to remove the secondary route. We’ll see another use case for programmatic routing next, but I usually find it best to userouterLinkwhenever possible over programmatic routing.