gpt4 book ai didi

angular8 - 无法绑定(bind)到 'rowData',因为它不是 'ag-grid-angular' 的已知属性

转载 作者:行者123 更新时间:2023-12-05 07:07:17 25 4
gpt4 key购买 nike

我正在尝试使用 Angular Ag-Grid 并在控制台中收到此错误,即“无法绑定(bind)到‘rowData’,因为它不是‘ag-grid-angular’的已知属性”

我已按照以下步骤操作:

1) npm install --save ag-grid-community ag-grid-angular

2) 从 'ag-grid-angular' 导入 { AgGridModule };

@NgModule({
...
imports: [AgGridModule.withComponents(null), ...],
})
export class GridModule {}

3) 在app.scss中,

@import 'ag-grid-community/dist/styles/ag-grid.css';
@import 'ag-grid-community/dist/styles/ag-theme-balham.css';

4) HTML

<ag-grid-angular 
style="width: 500px; height: 500px;"
class="ag-theme-balham"
[rowData]="rowData"
[columnDefs]="columnDefs">
</ag-grid-angular>

更新了 package.json 作为引用。我在我的项目中使用过。 {

"name": "proj-tool",
"version": "8.0.0",
"license": "Apache",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"test-ci": "TEST_CI=true ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^8.2.14",
"@angular/cdk": "~8.2.3",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.14",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"@auth0/angular-jwt": "^3.0.1",
"@babel/compat-data": "7.8.0",
"@ng-bootstrap/ng-bootstrap": "^5.1.4",
"@ng-select/ng-select": "^3.7.0",
"@ngx-translate/core": "11.0.1",
"@ngx-translate/http-loader": "4.0.0",
"ag-grid-angular": "^23.0.2",
"ag-grid-community": "^23.0.2",
"angular-bootstrap-md": "^8.8.1",
"angular-datatables": "^8.0.0",
"angular-tabs-component": "^1.0.6",
"bootstrap": "^4.4.1",
"chart.js": "2.7.3",
"core-js": "2.5.7",
"crypto-js": "^3.1.9-1",
"datatables.net": "^1.10.20",
"datatables.net-dt": "^1.10.20",
"file-saver": "^2.0.2",
"font-awesome": "4.7.0",
"jquery": "^3.4.1",
"jquery-validation": "^1.19.1",
"jquery-validation-unobtrusive": "^3.2.11",
"ng-block-ui": "^2.1.8",
"ng2-charts": "2.3.0",
"ngx-bootstrap": "^5.2.0",
"ngx-mask": "^8.1.7",
"ngx-select-dropdown": "^1.3.0",
"ngx-toastr": "^11.3.3",
"papaparse": "^5.2.0",
"popper.js": "^1.16.0",
"rxjs": "6.5.2",
"select2": "^4.0.13",
"tslib": "^1.10.0",
"yarn": "1.16.0",
"zone.js": "~0.9.1"
}

控制台中的附加错误: enter image description here

最佳答案

您可以尝试降级 ag-grid 版本 22.1.1 吗?或升级角度版本 9?当我在angular7中使用ag-grid时,我需要降级到ag-grid版本20.2。

关于angular8 - 无法绑定(bind)到 'rowData',因为它不是 'ag-grid-angular' 的已知属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62215026/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com