Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
117
rated 0 times [  124] [ 7]  / answers: 1 / hits: 22020  / 7 Years ago, mon, may 29, 2017, 12:00:00

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!


More From » angular

 Answers
9

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 {
}

[#57632] Thursday, May 25, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
saulthomasb

Total Points: 326
Total Questions: 98
Total Answers: 93

Location: Jordan
Member since Sun, Dec 26, 2021
2 Years ago
;