Custom Pipe


#1

Hi guys! I’ve created a custom pipe and added it to declarations in app.module, but my components still can’t see it… Thoughts?


#2

If you are using lazy loading, there is more work to be done - see Pipe not found (lazy loaded pages - using Josh Morony's checklist example)


#3

I want it to be universal pipe, accessible by all components


#4

If you mean “accessible by all components without importing the Pipe module in the component.module.ts” file of the components you need to use them in, then I don’t know a way - my knowledge is rather limited on this front (well, mostly any front as far as ionic2+ goes).

If you are ok with importing the pipe module in components that need it, it works well and you can use it across as many components as you want. I tried moving it to app.module.ts but the lazy loaded pages never “saw” the pipes

If it helps,

Maybe someone with more knowledge can chip in on how to do this for lazy modules if you don’t want to import in each page module


#5

Thank you for your reply!!! Yes, I am trying to avoid loading pipe into each component… and yes, those are lazy loading… I saw few posts about SharedModule solution, so I’ll try that out. Good to know that it’s not a problem specific to my code. Thanx!