contextMenu和CRUD表ngPrime angular2的问题

时间:2017-02-17 10:00:34

标签: angular datatable primeng

我在ngprime应用程序中使用angular2。我使用DataTable作为我的表格视图,并且能够排序,过滤但是当我尝试使用Crud功能或ContextMenu我收到错误时...

我的AppModule

import {SplitButtonModule} from "primeng/components/splitbutton/splitbutton";
@NgModule({
  declarations: [
    AppComponent,
    CarsComponent,
    ModsComponent
  ],
  imports: [
    BrowserModule, FormsModule,
    HttpModule, routing,
    DataTableModule, SharedModule,
    ButtonModule, DropdownModule,
    TieredMenuModule, SplitButtonModule
  ],
  providers: [
    AppConfig, CarsService,
    { provide: APP_INITIALIZER, useFactory: (config: AppConfig) => () => config.load(), deps: [AppConfig], multi: true }
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

ngPrime docs Here

中使用的示例代码

错误......

Unhandled Promise rejection: Template parse errors: Can't bind to 'model' since it isn't a known property of 'p-contextMenu'.
1. If 'p-contextMenu' is an Angular component and it has 'model' input, then verify that it is part of this module.
2. If 'p-contextMenu' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.
Unhandled Promise rejection: Template parse errors: Can't bind to 'visible' since it isn't a known property of 'p-dialog'.
1. If 'p-dialog' is an Angular component and it has 'visible' input, then verify that it is part of this module.
2. If 'p-dialog' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message.

我在这里错过了任何进口商品吗?

1 个答案:

答案 0 :(得分:2)

您必须在模块导入中从ContextMenuModule导入DialogModuleprimeng/primeng