Hello,
I am making angular routing. I made a login screen, according to this, it seems that the home component does not go when it should. Because home componente menu is not working. It works fine when I refresh the page.
What is this problem? How can i solve it. I would be glad if you write what I need to do by looking at my code.
JavaScript
const routes: Routes = [
{path:'login', component:LoginComponent},
{ path:'home',component:HomeComponent},
{path:'add-users',component:AddEditUsersComponent},
{path:'users',component:UsersComponent},
{path: 'show-users',component:ShowUsersComponent},
{path: 'claims', component:ClaimsComponent},
{path: 'add-claims', component:AddEditClaimsComponent},
{path: 'show-claims', component:ShowClaimsComponent}
];passlogin(){
this.service.login(1).subscribe(res=>{
this.router.navigateByUrl('/home');
});
}

Sachin SinghRank #66 · 26.2K reputationPosted Nov 26, 2021, 9:08 AM EST
Ali Ylmaz151 reputationPosted Nov 28, 2021, 7:38 AM EST
Amit Kumar SinghRank #562 · 4.3K reputationPosted Nov 28, 2021, 9:12 AM EST
Hi,
this.service.login(1).subscribe(res=>{
this.router.navigate(['home']);
}); });
Pls. check this one
Thanks !
Ali Ylmaz151 reputationPosted Nov 29, 2021, 12:35 AM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 29, 2021, 12:43 AM EST
Ali Ylmaz151 reputationPosted Nov 29, 2021, 1:01 AM EST
Ali Ylmaz151 reputationPosted Nov 30, 2021, 1:10 AM EST