我试图执行这个Ag Grid for Angular CLI,我已经按照他们在文档中提到的每一个步骤操作,但Value列是空的并且不显示数据。我在控制台中看到没有错误。我试图调试,但没有运气。请帮助Ag Grid not display data
请告诉我,我做错了
MyGridApplicationComponent
import {
Component,
OnInit
} from '@angular/core';
import {
GridOptions
} from "ag-grid";
import {
RedComponentComponent
} from "../red-component/red-component.component";
@Component({
selector: 'app-my-grid-application',
templateUrl: './my-grid-application.component.html',
styleUrls: ['./my-grid-application.component.css']
})
export class MyGridApplicationComponent {
private gridOptions: GridOptions;
constructor() {
this.gridOptions = <GridOptions> {};
this.gridOptions.columnDefs = [{
headerName: "ID",
field: "id",
width: 200
},
{
headerName: "Value",
field: "value",
cellRendererFramework: RedComponentComponent,
width: 200
},
];
this.gridOptions.rowData = [{
id: 5,
value: 10
},
{
id: 10,
value: 15
},
{
id: 15,
value: 20
}
]
}
}
RedComponentComponent
import {
Component
} from "@angular/core";
@Component({
selector: 'app-red-component',
templateUrl: './red-component.component.html'
})
export class RedComponentComponent {
private params: any;
agInit(params: any): void {
this.params = params;
}
}