angular - Angular 6 AOT 编译错误:装饰器中不支持函数调用
问题描述
我在我的 Angular 项目上ng-intercom
从(https://www.npmjs.com/package/ng-intercom)安装,实现了这一点。它的工作,但在ng serve
模式。但是当我执行命令ng build --prod
或ng build --aot
. 我得到错误:
ERROR in Error during template compile of 'AppModule'
Function calls are not supported in decorators but 'IntercomModule' was called.
我执行时它工作正常ng build
。
这是我的AppModule
:
import { IntercomModule } from 'ng-intercom';
@NgModule({
declarations: [MyComponent],
imports: [
BrowserModule,
BrowserAnimationsModule,
HttpClientModule,
IntercomModule.forRoot({
appId: 'my_id',
updateOnRouterChange: true,
}),
],
providers: [],
bootstrap: [MyComponent],
})
export class AppModule {}
解决方案
这在版本中已修复7.0.0-beta.1
。快乐编码:)
推荐阅读
- python - HaarCascade 训练:合并 .lst 文件
- flask-sqlalchemy - 如何对 flask-admin 数据库列执行操作以将结果存储在同一表的其他列中
- python - 使用自签名证书将 pip install 安装到私有 pypi 服务器时如何忽略引发的安全警告
- laravel - 如何配置 Laravel Passport 的 '/oauth/token' 速率限制?
- django - Markdown 模板无法正确呈现 HTML
- c# - Removing items in a list of list
- elixir - Ecto query unique through a belongs_to association?
- c - 使用后量子公钥算法在 C 中创建 X509 证书?
- groovy - Groovy 流为 .peek 和 .map 提供 MissingMethodException
- java - ActiveMQ 是否支持消费者的最大消息处理时间