我正在使用PrimeNg作为我的angular2项目,我正在尝试在页面中添加面板.我使用下面的代码来获取primeng教程(
http://www.primefaces.org/primeng/#/panel): –
- <p-panel>
- <p-header>
- Header content here
- </p-header>
- Body Content
- </p-panel>
我在primeng的模块中添加了导入的必需模块: –
- import { NgModule,CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
- import { MyComponent } from './my.component';
- import { CommonModule } from '@angular/common';
- import { SharedModule,PanelModule } from 'primeng/primeng';
- @NgModule({
- imports: [
- CommonModule,SharedModule,PanelModule
- ],declarations: [MyComponent],schemas: [CUSTOM_ELEMENTS_SCHEMA ]
- })
- export class ThemeModule { }
这在控制台中抛出以下错误: –
EXCEPTION: Uncaught (in promise): Error: Template parse errors:
‘p-header’ is not a known element:
1. If ‘p-header’ is an Angular component,then verify that it is part of this module.
2. If ‘p-header’ is a Web Component then add “CUSTOM_ELEMENTS_SCHEMA” to the ‘@NgModule.schemas’ of this component to suppress this message.
(“
随着2.0-RC.1 primeng的改变,以及如果你升级你的版本,它将工作.