What is the correct way to create navbar and sidebar in angular, When I enter a link in my project, it loads the sidebar and the navbar and that does not seem to be correct. There are also pages in which I do not want to show the sidebar.
My routes are declared in the same way.
RouterModule.forRoot([
{
path:'',
component:HomeComponent,
canActivate:[AuthGuard],
children: [
{ path: '',
component: SidebarComponent
},
{ path: '',
outlet: 'navbar',
component: NavbarComponent
}
]
},
{
path:'consulta',
component:ConsultaComponent,
canActivate:[AuthGuard],
children: [
{ path: '',
component: SidebarComponent
},
{ path: '',
outlet: 'navbar',
component: NavbarComponent
}
]
},
{
path: "login",
component: LoginComponent
},
{
path: "repdepto/:idDepto",
component: RepdeptoComponent,
canActivate:[AuthGuard],
}
])