You can use ngIF directive on components where nav is located
after you get the current route:
this.router.events.subscribe(event => {
if (event.constructor.name === "NavigationEnd") {
this.name = (event).url.split("/").slice(-1)[0];
this.isLogin = this.currentRoute === 'login';
}
})