使用Angular 2.2.3,我有一个像这样的文件夹/文件结构:
/proposals
index.ts <- exports everything inside '/proposals'
proposals.routes.ts
/proposals/proposal-document/ProposalDocumentComponent.ts
/proposals/component2
/proposals/component3 etc.
proposals.routes.ts的内容:
import { Routes } from '@angular/router';
import { ProposalDocumentComponent } from './';
export const PROPOSAL_ROUTES: Routes = [
{ path: ':id/document', component: ProposalDocumentComponent }
]
在我app-routing.module.ts
内部我导入常量并使用它:
import { PROPOSAL_ROUTES } from './proposals';
const routes: Routes = [
...lots of routes..
{ path: 'proposals', component: ProposalsComponent, children: PROPOSAL_ROUTES },
]
这会引发错误“错误:未激活插座”
这是否不再受支持?