我有一个angular项目,其中我使用app.module.ts中的以下代码导入一个模块:
@NgModule({
imports: [
...,
NgxEchartsModule.forRoot({
echarts: () => import('echarts')
}),
],
})但当我试图将项目构建成无服务器时,我得到了关于上述导入的以下内容,并要求我将其更改为导出功能,以便decarator可以支持它。我该怎么做?我尝试了不同的导出方法,但不起作用。
ERROR in src/app/app.module.ts(107,16): Error during template compile of 'ɵ0'
Function expressions are not supported in decorators
Consider changing the function expression into an exported function.作为参考,我尝试将ngx-echarts导入到angular项目中。https://www.npmjs.com/package/ngx-echarts
谢谢你的帮助。
发布于 2020-10-18 10:28:01
下面的方法对我很有效:
NgxEchartsModule.forRoot({ echarts })eChart exception (NgxEchartsDirective -> InjectionToken NGX_ECHARTS_CONFIG)
https://stackoverflow.com/questions/64407961
复制相似问题