Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot bind to 'gridOptions' since it isn't a known property of 'ag-grid-angular'

I'm trying to run the example project of ag-grid but getting the following exception:

Can't bind to 'gridOptions' since it isn't a known property of 'ag-grid-angular'

Code:

<div style="width: 200px;">
  <ag-grid-angular #agGrid style="width: 100%; height: 200px;" 
    [gridOptions]="gridOptions" class="ag-fresh">
  </ag-grid-angular>
</div>

It says that there isn't such a prop as 'gridOptions' on ag-grid-angular. It's weird since it comes from the official website of ag-grid.

Any help will be profoundly appreciated!

like image 403
Alon Avatar asked May 29 '17 09:05

Alon


1 Answers

It seems you have not registered AgGridModule with @NgModule({})

Please try below code if missed:

import {NgModule} from "@angular/core";
import {AgGridModule} from "ag-grid-angular/main";

import {AppComponent} from "./app.component";
import {MyGridApplicationComponent} from "./my-grid-application/my-grid-application.component";
import {RedComponentComponent} from "./red-component/red-component.component";

@NgModule({
    declarations: [
        AppComponent,
        MyGridApplicationComponent,
        RedComponentComponent
    ],
    imports: [
        BrowserModule,
        AgGridModule.withComponents(
            [RedComponentComponent]
        )
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {
}
like image 152
Suneet Bansal Avatar answered Oct 18 '22 16:10

Suneet Bansal