【发布时间】:2022-10-22 02:40:02
【问题描述】:
我正在尝试按照文档https://documentation.engagespot.co/docs/javascript-guide/using-angular-package 在我的 Angular 应用程序中设置 Engagespot
这是代码。
import { Component, ViewChild, ElementRef, AfterViewInit } from "@angular/core";
import { render } from "@engagespot/client";
@Component({
selector: "app-root",
templateUrl: "./app.component.html"
})
export class AppComponent implements AfterViewInit {
@ViewChild("engagespotBellIcon") engagespotBellIcon: ElementRef;
ngAfterViewInit() {
render(this.engagespotBellIcon.nativeElement, {
apiKey: "<api_key>",
userId: "user@sample.com",
theme: {} //Theme Object to Customize the look and feel of the notification inbox.
});
}
}
但它显示错误
SyntaxError
/node_modules/@engagespot/core/dist/esm/index.js: Support for the experimental syntax 'classProperties' isn't currently enabled (1:1717):
更新我尝试了这里提到的 babel 配置 - Support for the experimental syntax 'classProperties' isn't currently enabled。但是同样的错误。
【问题讨论】:
-
我注意到奇怪的事情。当我尝试时,它可以在我的本地机器上运行。我一直在尝试使用代码沙箱。
-
不,它没有用
-
我在codesandbox中尝试了多个babel配置,但同样的错误。
标签: javascript angular