最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin4浏览0评论

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!

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!

Share Improve this question edited Sep 30, 2020 at 8:04 HDJEMAI 9,80048 gold badges76 silver badges98 bronze badges asked May 29, 2017 at 9:07 AlonAlon 11.9k28 gold badges102 silver badges172 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 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 {
}

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论