I\'m doing a test with Angular 6 and Ag-Grid. I have done an example and it paints it, I mean the css and so on.
But by doing the example below and enter the real da
Try as below:
@Component({
selector: "my-app",
template: `
`
})
export class AppComponent {
private gridApi;
private gridColumnApi;
private rowData: any[];
private columnDefs;
private defaultColDef;
private defaultColGroupDef;
private columnTypes;
constructor(private http: HttpClient) {
this.columnDefs = [
{
headerName: 'ID',
field: 'id',
width: 100
},
{
headerName: 'Nombre',
field: 'name',
width: 200
}
];
}
onGridReady(params) {
this.gridApi = params.api;
this.gridColumnApi = params.columnApi;
this.http
.get(
"https://raw.githubusercontent.com/ag-grid/ag-grid/master/packages/ag-grid-docs/src/olympicWinnersSmall.json"
)
.subscribe(data => {
this.rowData = data;
});
}