所以我的问题是我无法访问路径'/ dashboard / users / add-user'或users-routing.module.ts中的任何其他路由(默认(空)路由除外),并且卡住了上述错误。需要一些来逃避这个。下面是我的代码的一些必要部分。
const routes: Routes = [
{ path: 'dashboard', loadChildren: './dashboard/dashboard.module#DashboardModule', data: {title:'Dashboard'} },
{ path: '', redirectTo: '/dashboard/transactions', pathMatch: 'full' },
]
const routes: Routes = [
{
path: '', component: DashboardComponent, children: [
{ path: 'users', pathMatch: 'full', loadChildren: './users/users.module#UsersModule',data:{title:'Users'} },
]
}]
const routes: Routes = [
{ path:'', component:UsersLandingComponent },
{ path:'add-user', component:AddUserComponent, pathMatch:'full', data:{title: 'Add User'}}
]
<nav mat-tab-nav-bar color="accent">
<a mat-tab-link *ngFor="let link of navLinks; let i = index" [routerLink]="link.path" routerLinkActive #rla="routerLinkActive" [active]="activeLinkIndex === i"
(click)="activeLinkIndex = i">{{link.label}}</a>
</nav>
<router-outlet></router-outlet>