Home:ALL Converter>What are the child routes in the angular for?

What are the child routes in the angular for?

Ask Time:2022-11-08T16:06:05         Author:Santa Monica

Json Formatter

{path: 'user/home', component: HomeComponent},
{path: 'user/other', component: OtherComponent}

And

{
  path: 'user', children: [
    {path: 'home', component: HomeComponent},
    {path: 'other', component: OtherComponent}
  ]
}

What are child routes to angular for? What is the fundamental difference between these two records?

Will patchmatch work the same for both cases? What I mean. Angular divides the url path into a tree of segments (user/list -> user, list).

pathMatch: full tells angular that it is required to match the segment value completely without going down to the child elements if this value does not match. Is it true that regardless of the recording option, the url segment tree will have the same structure?

I'm a little confused about the division of URLs into segments and the correlation of these segments with child components in angular.

Author:Santa Monica,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/74357458/what-are-the-child-routes-in-the-angular-for
MGX :

There's none, it's just easier to write the second one, because you can apply guards and such at parent level.\n{\n path: 'user', canActivateChild: [ActivateGuard], children: [\n {path: 'home', component: HomeComponent},\n {path: 'other', component: OtherComponent}\n ]\n}\n\n{path: 'user/home', canActivate: [ActivateGuard], component: HomeComponent},\n{path: 'user/other', canActivateChild: [ActivateGuard], component: OtherComponent}\n\nIt's like every piece of code, the more you can factorize it, the better it is.",
2022-11-08T08:10:15
yy