Ali Ylmaz

Ali Ylmaz

  • NA
  • 129
  • 10.7k

Angular Routing

Nov 26 2021 1:31 PM

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.

 

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');

    });

 

   

  }


Answers (7)