I am using following AG Grid version;
- ag-grid@17.1.1
- ag-grid-angular@17.1.0
I am following the getting started part of the ag-grid site itself.
And my code is as follow;
In app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { HttpClientModule } from '@angular/common/http';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { AgGridModule } from 'ag-grid-angular';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
HttpClientModule,
FormsModule,
AgGridModule.withComponents([]),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
And in the component itself;
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-table',
templateUrl: './app-table.component.html',
styleUrls: [
'./adwalnut-table.component.css',
'./../../../node_modules/ag-grid/dist/styles/ag-grid.css',
'./../../../node_modules/ag-grid/dist/styles/ag-theme-balham.css'
]
})
export class AppTableComponent implements OnInit {
columnDefs;
rowData;
constructor() { }
ngOnInit() {
this.columnDefs = [
{headerName: 'Make', field: 'make' },
{headerName: 'Model', field: 'model' },
{headerName: 'Price', field: 'price'}
];
this.rowData = [
{ make: 'Toyota', model: 'Celica', price: 35000 },
{ make: 'Ford', model: 'Mondeo', price: 32000 },
{ make: 'Porsche', model: 'Boxter', price: 72000 }
];
}
}
My HTML is like;
<ag-grid-angular
style="width: 500px; height: 500px;"
class="ag-theme-balham"
[rowData]="rowData"
[columnDefs]="columnDefs"
>
</ag-grid-angular>
Now my output is like;
Now I checked and noticed that there is no error in console. I followed exact same step that is provided into their getting started guideline, except I am using css not SCSS or SASS.
Is it an issue with version? I am trying for a long time. Any help will be very good for me.
Thanks in advance.