本文介绍了contextMenu和CRUD表ngPrime angular2的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 angular2 应用程序中使用 ngprime 。我在表视图中使用 DataTable 并能够进行排序,过滤,但是当我尝试使用 Crud 功能或 ContextMenu 我遇到错误...

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...

我的 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文档中使用的示例代码

错误...

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?

推荐答案

您必须从 ContextMenuModule 和 DialogModule >在模块导入中> primeng / primeng 。

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

这篇关于contextMenu和CRUD表ngPrime angular2的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 23:25