Can't bind to 'rowData' since it isn't a known property of 'ag-grid-angular'

Viewed 1892

I am trying to use Angular Ag-Grid and getting this error in console i.e. "Can't bind to 'rowData' since it isn't a known property of 'ag-grid-angular'"

I have followed below steps:

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

2) import { AgGridModule } from 'ag-grid-angular';

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

3) In app.scss,

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

4) in HTML

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

Updated package.json for the reference. I have used in my project. {

"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"
  }

Attached Error in console: enter image description here

1 Answers

Can you try dowgrade ag-grid version 22.1.1? or upgrade angular version 9? When I use ag-grid in angular7, I need to downgraded to ag-gZrid version 20.2.

Related