xym_Blog
OliverMing
采纳率33.3%
2019-05-21 15:16 阅读 567

angular中,多个组件引用同一个管道

10

我的情况是这样,多个组件组件同时使用了管道FormatHtmlPipe。报错如下:

Error: Type FormatHtmlPipe is part of the declarations of 2 modules: NewmsgModule and ChatroomPageModule! Please consider moving FormatHtmlPipe to a higher module that imports NewmsgModule and ChatroomPageModule. You can also create a new NgModule that exports and includes FormatHtmlPipe then import that NgModule in NewmsgModule and ChatroomPageModule.

把FormatHtmlPipe直接在app.modules中引入,组件中又提示找不到FormatHtmlPipe

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

相关推荐