ngx-datatable 不能在环境上下文中声明访问器

ARH*_*ARH 2 ionic-framework ngx-datatable angular ionic5

我在尝试添加ngx-datatable到我的ionic + angular项目时遇到错误。我收到了成百上千的错误行,它似乎没有添加ngx-database到我的项目中。我正在关注Add ngx-datatable with ionic 5以添加ngx-datatable到我的项目中。

包.json

"@angular/common": "~8.2.14",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.14",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"@ionic-native/core": "^5.0.7",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^5.0.0",
"@swimlane/ngx-datatable": "^17.0.0",
"core-js": "^2.5.4",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
Run Code Online (Sandbox Code Playgroud)

在 app/home.module.ts

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { CommonModule } from '@angular/common';
import { IonicModule } from '@ionic/angular';
import { FormsModule } from '@angular/forms';
import { HomePage } from './home.page';
import { HomePageRoutingModule } from './home-routing.module';
import { NgxDatatableModule } from '@swimlane/ngx-datatable';
@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    IonicModule,
    HomePageRoutingModule, NgxDatatableModule
  ],
  declarations: [HomePage],
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class HomePageModule {}
Run Code Online (Sandbox Code Playgroud)

和错误

ERROR in node_modules/@swimlane/ngx-datatable/lib/components/body/body-cell.component.d.ts:8:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 8     set group(group: any);

node_modules/@swimlane/ngx-datatable/lib/components/body/body-cell.component.d.ts:9:9 - error TS1086: An accessor cannot be declared in an ambient context.
[ng] 9     get group(): any;
Run Code Online (Sandbox Code Playgroud)

我想我的版本ionic+angular不兼容或ngx-datatable不兼容或我正在努力解决的任何其他错误。

ARH*_*ARH 6

解决了。ngx-datatable版本17.0.0与我在 package.json 文件中的 ionic + angular 版本不兼容。我只是安装了ngx-datatable16.1.1 版本并解决了问题。

npm i @swimlane/ngx-datatable@16.1.1 --save
Run Code Online (Sandbox Code Playgroud)