[英]I have imported a Breadcrumb module from Primeng and tryting to use as example. But it is giving error in my template
I am trying to use Breadcrumb menu from primeng in my angular project.我正在尝试在我的 angular 项目中使用 primeng 的面包屑菜单。 I have imported it in
app.module.ts
file.But still its giving error in my template.我已经将它导入到
app.module.ts
文件中。但它仍然在我的模板中给出错误。 Is there any thing I have to do?有什么我必须做的吗?
It is giving below error:它给出以下错误:
p-breadcrumb' is not a known element:
1. If 'p-breadcrumb' is an Angular component, then verify that it is part of this module.
2. If 'p-breadcrumb' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. Error occurs in the template of component BreadcrumbComponent and I am not able to solve this.
I have import import {BreadcrumbModule} from primeng/breadcrumb
;我有 import import {BreadcrumbModule} from
primeng/breadcrumb
; and still its not working as well as import {BreadcrumbModule} from primeng/breadcrumb
;.并且它仍然无法正常工作以及从
primeng/breadcrumb
导入 {BreadcrumbModule} ;。 Imported to .ts
file.导入到
.ts
文件。
I want to solve solve this error我想解决这个错误
Image 1图片 1
Image 2图 2
Looking at your screenshots i guess you declared the breadcrumb component in your own BreadcrumbModule.查看您的屏幕截图,我猜您在自己的 BreadcrumbModule 中声明了面包屑组件。 but you are importing the primeNg BreadcrumbModule in the AppModule.
但是您正在 AppModule 中导入 primeNg BreadcrumbModule。
you should move or copy the primeNg import to your own BreadcrumbModule (the module where your BreadcrumbComponent is declared)您应该将 primeNg 导入移动或复制到您自己的 BreadcrumbModule(声明 BreadcrumbComponent 的模块)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.