加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

‘p-header’不是PrimeNg for Angular2应用程序中的已知元素

发布时间:2020-12-17 07:29:15 所属栏目:安全 来源:网络整理
导读:我正在使用PrimeNg作为我的angular2项目,我正在尝试在页面中添加面板.我使用下面的代码来获取primeng教程( http://www.primefaces.org/primeng/#/panel): – 我的html文件有以下代码: – p-panel p-header Header content here /p-header Body Content/p-p
我正在使用PrimeNg作为我的angular2项目,我正在尝试在页面中添加面板.我使用下面的代码来获取primeng教程( http://www.primefaces.org/primeng/#/panel): –

我的html文件有以下代码: –

<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的改变,以及如果你升级你的版本,它将工作.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读