issue with contextMenu and CRUD table ngPrime angular2

孤者浪人 提交于 2019-12-24 09:58:13

问题


I am using ngprime in my angular2 application. I am using DataTable for my table view and able to sort, filter but when I try to use Crud functionality or ContextMenu I am getting errors...

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

Sample code used from ngPrime docs found Here

Error ...

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.

Am I missing any imports here?


回答1:


You have to import ContextMenuModule and DialogModule from primeng/primeng in your module imports.



来源:https://stackoverflow.com/questions/42294880/issue-with-contextmenu-and-crud-table-ngprime-angular2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!