简体   繁体   English

我已经从 Primeng 导入了一个 Breadcrumb 模块并尝试用作示例。 但它在我的模板中出错

[英]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.

相关问题 我想在我的应用程序中使用ng2-charts。尽管我已正确导入它,但仍然给我一个错误。找不到模块“ ng2-charts / ng2-charts” - I want to use ng2-charts in my app.though I have imported it correctly still it is giving me an error Cannot find module “ng2-charts/ng2-charts” 面包屑中的PrimeNG推送项目来自其他模块 - PrimeNG push item in breadcrumb from other module 我该怎么做才能在我的 Angular 项目中使用 PrimeNG FullCalendar? - What have I to do to use PrimeNG FullCalendar into my Angular project? 使用 primeNG 从版本 4 到 14 的 Angular 升级为 primeNG 组件提供错误 - Angular upgrade from version 4 to 14 with primeNG giving error for primeNG components 使用导入模块中的组件 - Use component from imported module ngModel 不工作(我导入的表单模块) - ngModel is not working (Forms Module I have imported) 使用导入模块中的自定义组件 - Use custom component from imported module 如何在PrimeNG面板中使用模板 - How to use template in PrimeNG panelMenu 如何防止我导入的模块覆盖我的路由? - How can I prevent my imported module from overriding my routes? 使用PrimePrimeNG时会全部导入它,还是摇树? 我如何自己确定? - Is the entirety of PrimeNG imported when you use it, or is it tree shaken? How can I determine it by myself?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM