FeatureModule fails during an AOT build when static forRoot has arguments
问题 I am encountering an AOT build issue using Angular@5.1.0. The error is: ERROR in Error during template compile of 'AppModule' Function calls are not supported in decorators but 'FeatureModule' was called. feature.module.ts @NgModule({ imports: [ BrowserModule, RouterModule.forRoot([]) ], declarations: [ ... ], exports: [ ... ] }) export class FeatureModule{ static forRoot(items:any[]): ModuleWithProviders { const routes:Routes = items.map(t=> { return { path: t.name, component: t.component };