I am facing an issue with my HTML code and Angular components:
<ag-grid-angular [gridOptions]="gridOptions"></ag-grid-angular>
My component code is as follows:
import {GridOptions} from 'ag-grid';
...
export class SampleComponent{
gridOptions: GridOptions;
}
...
In my app.module.ts file, I have the following setup:
import {NgModule} from "@angular/core";
import {AgGridModule} from "ag-grid-angular/main";
import {AppComponent} from "./app.component";
...
@NgModule({
declarations: [...],
imports: [
...
AgGridModule.withComponents([])
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}
I am receiving an error message that says:
Error: Uncaught (in promise): Error: Template parse errors: Can't bind to 'gridOptions' since it isn't a known property of 'ag-grid-angular'.
- If 'ag-grid-angular' is an Angular component and it has 'gridOptions' input, then verify that it is part of this module.
- If 'ag-grid-angular' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.