0
我的文件夹结构,如:如何loadChildren异步与角路由器装载机
- app
-core
-vacancy
在core
文件夹我有app.routing.ts
,我想异步添加路由空缺。
我做到了像:
export const routing = RouterModule.forRoot([
{
path: '',
component: HomeComponent,
canActivate: [AuthGuard]
},
{
path: 'vacancy',
loadChildren: '../vacancy#VacancyModule'
},
{
path: '**',
component: NotFoundComponent
}
], {useHash: true}
);
我得到一个错误:
Can't resolve '..\vacancy'
dispite事实存在的文件夹空缺文件夹app
和空缺的里边有一个文件vacancy.module.ts
这`外观像:
// some imports here
@NgModule({
declarations: [
VacancyBaseComponent
],
imports: [
CommonModule,
FormsModule,
RouterModule.forChild(routes),
],
})
export class VacancyModule {
public static routes = routes;
}
任何想法我做错了什么?