【发布时间】:2020-01-27 12:47:39
【问题描述】:
我创建了共享模块,我在其中导入了角度 ag - 网格。
因此,根据 ag - grid 的办公站点,我们必须在 imports 中写入 AgGridModule.withComponents([])。
但我也必须导出它,因为我想将此导出用作我的一个延迟加载模块中的导入,而不是直接在 appModule 中。
但是从共享模块中导出 AgGridModule.withComponents([]) 会出现错误。
shared.module.ts
import { AgGridModule } from 'ag-grid-angular';
imports: [
AgGridModule.withComponents([])
]
enter code here`enter code here`
exports: [
AgGridModule.withComponents([]) // this export is giving error
]
错误说明:
Type 'ModuleWithProviders<any>' is not assignable to type 'any[] | Type<any>'. Type 'ModuleWithProviders<any>' is missing the following properties from type 'Type<any>': apply, call, bind, prototype, and 5 more
【问题讨论】:
标签: angular module lazy-loading