我正在按照以下步骤使用OfficeJS创建新的Excel加载项: https://docs.microsoft.com/en-us/office/dev/add-ins/excel/excel-add-ins-get-started-angular
在我的app.component.ts中,我想注入NgZone,所以我添加了以下几行:
import { NgZone } from '@angular/core';
.
.
.
constructor(private zone: NgZone) {
}
运行“ npm start”时,出现此错误:
ERROR in ./src/app/app.component.ts
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: C:/Users/bob/Git/Excel Addin/src/app/app.component.ts: Unexpected token, expected , (16:24)
14 | export default class AppComponent {
15 |
> 16 | constructor(private zone: NgZone) {
| ^
17 |
18 | }
19 |
我该如何解决?请告知。