I am using the AG-GRID api to populate a table in my website under the main.ts file i have added the following code
import { bootstrap } from 'angular2/platform/browser';
import { AppComponent } from './app.component';
import { ROUTER_PROVIDERS } from 'angular2/router';
import { AgGridModule } from 'ag-grid-ng2/main';
bootstrap(AppComponent, [ROUTER_PROVIDERS],AgGridModule);
my main component.ts file is as following
import { Component } from 'angular2/core';
import { GridOptions } from 'ag-grid/main';
@Component({
moduleId: module.id,
templateUrl:"app/grid.component.html";
})
export class gridComponent{
public gridOptions:GridOptions;
constructor() {
this.gridOptions = <GridOptions>{};
this.gridOptions.rowData = this.createRowData();
this.gridOptions.columnDefs = this.createColumnDefs();
}
private onCellValueChanged($event) {
this.gridOptions.api.refreshCells([$event.node],["cube"]);
}
private createColumnDefs() {
return [
{headerName: "Row 1", field: "row", width: 140}
];
}
public refreshRowData() {
let rowData = this.createRowData();
this.gridOptions.api.setRowData(rowData);
}
private createRowData() {
let rowData:any[] = [];
for (var i = 0; i < 15; i++) {
rowData.push({
row: "Name" + i
});
}
console.log(rowData);
return rowData;
}
}
When i compile i get a error of module not found. Can anyone help Thanks in advance