使用Angular 6 (1)这是路由数组
const appRoutes: Routes = [
{
path: 'dashboard',
component: DashboardComponent
},
{
path: 'administration',
children: [
{
path: 'users',
component: UserListComponent,
resolve: { userList: UserListResolverService }
},
{
path: 'user-groups',
component: UserGroupListComponent
},
{
path: 'permissions',
component: PermissionComponent
},
{
path: '',
component: UserListComponent,
resolve: { userList: UserListResolverService }
}
]
},
{
path: '',
redirectTo: 'dashboard',
pathMatch: 'full'
},
{
path: '**',
redirectTo: 'PageNotFoundComponent',
pathMatch: 'full'
},
];
(2)在“管理”的父菜单下单击任何子菜单,该路由将起作用并显示正确的组件模板。 例如,它通过单击用户组显示用户组列表。但是,无论我单击哪个子链接,URL地址栏都保持为http://localhost:46325/administration。
The route tracing has correct url though
e.g., NavigationStart {id: 16, url: "/administration/user-groups", navigationTrigger: "imperative", restoredState: null}
我不确定这是怎么回事。有人可以指出我正确的方向吗?非常感谢。