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

1

9

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!

Redblooded answered 29/5, 2017 at 9:7 Comment(0)
E
18

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 {
}
Erythrite answered 29/5, 2017 at 9:21 Comment(1)
don't forget to restart your app serverArsphenamine

© 2022 - 2024 — McMap. All rights reserved.