Somebody can tell me if is possible to open a child route in a new view instead of opening right under it? If so how and how to comeback to the father route previous state of navigation?
Angular route and child route management
49 Views Asked by Pedro At
2
There are 2 best solutions below
0

It's good to use children
, because if you want to use some guard
s it's gonna work for all children routes, it's very useful when you're creating authenticated routes.
Example:
const routes: Routes = [
{
path: 'first',
children: [
{ path: '', component: FirstComponent },
{ path: 'second', component: SecondComponent },
{
path: 'third',
canActivate: [YourGuard],
children: [
{ path: '', component: ThirdComponent },
{ path: 'another-route', component: FourthComponent },
]
}
],
}
];
Instead of
Do: