2017-05-29 73 views
0

我試圖運行the example project of ag-grid但得到以下異常的已知屬性:不能綁定到「gridOptions」,因爲它不是「AG-網角」

不能結合「 gridOptions',因爲它不是 的已知屬性‘AG-網格角’

代碼:

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

它說,不存在這樣的道具爲「gridOp在ag-grid-angular上。這很奇怪,因爲它來自Ag-grid的官方網站。

任何幫助將深深感激!

回答

2

好像你還沒有@NgModule({})

註冊AgGridModule請嘗試以下代碼,如果錯過:

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

砰!!!!!!!!上 – ritesh

相關問題