[英]Error TS2339: Property 'Default' does not exist on type 'string'.**
[英]app/app.component.ts(192,17): error TS2339: Property 'init' does not exist on type 'Intercom'
app / app.component.ts(192,17):錯誤TS2339:類型'Intercom'不存在屬性'init'。
包https://www.npmjs.com/package/ng-intercom
ngOnInit(): void {
this.intercom.init({
app_id: "mobilecode",
// Supports all optional configuration.
widget: {
"activator": "#intercom"
}
});
在您的應用程序模塊中:
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`
})
...
]
})
我通過使用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。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.