ag-grid gridOptions.api undefined in angular 2
问题 I am trying ag-grid in angular2 with typescript, for some reasons I am not able to use the ag-grid APIs, getting undefined error., here is the code.., import { AgRendererComponent } from 'ag-grid-ng2/main'; import { GridOptions, RowNode } from 'ag-grid/main'; import { GridOptionsWrapper } from 'ag-grid/main'; import { GridApi } from 'ag-grid/main'; public gridOptions: GridOptions; constructor() { this.gridOptions = <GridOptions>{}; alert(this.gridOptions); alert(this.gridOptions.api); // ***