app/app.component.ts(192,17):error TS2339:属性'init‘在'Intercom'.类型中不存在
封装https://www.npmjs.com/package/ng-intercom
ngOnInit(): void {
this.intercom.init({
app_id: "mobilecode",
// Supports all optional configuration.
widget: {
"activator": "#intercom"
}
});发布于 2018-01-17 10:14:53
在你的应用模块中:
import { IntercomModule } from 'ng-intercom';
@NgModule({
imports: [
...
IntercomModule.forRoot({
appId: <your_app_id>, // from your Intercom config
updateOnRouterChange: true // will automatically run `update` on router event changes. Default: `false`
})
...
]
})发布于 2018-01-26 13:21:24
我使用update()而不是init()使它工作(在1.0.0-beta.11中)。我所做的是更改ngOnInit()中的行
从…
this.intercom.init({至
this.intercom.update({然后整个块看起来如下:
ngOnInit() {
this.intercom.update({
app_id: <app_id>,
// Supports all optional configuration.
widget: {
"activator": "#intercom"
}
});
}希望这能有所帮助!
(另一个快速修复方法是将init()确实工作的级别降到1.0.0-beta.10。)
https://stackoverflow.com/questions/48296578
复制相似问题