ionic4 pipe.ts is part of the declarations of 2 modules:

网友投稿 642 2022-11-20

ionic4 pipe.ts is part of the declarations of 2 modules:

ionic4 pipe.ts is part of the declarations of 2 modules:

目录

​​问题复现​​​​解决思路:​​​​实操:​​

​​新建个module​​​​在需要的页面导入shareModule​​

问题复现

解决思路:

既然不可以这样,那我们就自己建立一个模块module,吧自己自定义的过滤器和指令放在这个共享的module里面。 这样不就解决了。

实操:

自定义的过滤器

自定义的指令

新建个module

import { NgModule } from '@angular/core';import { CommonModule } from '@angular/common';import {ConvertWeekPipe} from '../../pipes/convert-week.pipe';import {DebounceClickDirective} from '../../directives/debounce-click.directive';@NgModule({ declarations: [ ConvertWeekPipe, DebounceClickDirective ], imports: [ CommonModule ], exports: [ ConvertWeekPipe, DebounceClickDirective ]})export class ShareModule { }

在需要的页面导入shareModule

完事,效果图不展示了,收工。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:MapReduce框架--InputFormat数据输入--切片优化(11)
下一篇:Js处理异步async,await
相关文章

 发表评论

暂时没有评论,来抢沙发吧~