Conclusion first: if the last path is a parameter, put it last in the peer route or the route below it cannot go to it

users/create users/result users/:id // path: 'users', component: LoginLayoutComponent, children: [ {path: 'create'}, {path: ': id'}, / / pay attention to the position of his {path: 'result'},]Copy the code

When the browser enters the address: users/result, the route will always be users/: ID. Since ID is a variable, the routing algorithm will assume that ‘result’ is the value of ID instead of going to users/result

The correct way to write it is: put the parameter in the last position

Path: 'users', Component: LoginLayoutComponent, children: [{path: 'create'}, {path: 'result'}, {path: ':id'},// note his position]Copy the code