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?
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)
I want it to be universal pipe, accessible by all components
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,
- This is my master pipe NgModule that imports all my pipes (needed for lazy loading, it seems)
- [This] (https://github.com/pliablepixels/medfolio/blob/master/src/pages/category/category.module.ts) is how I use the pipe in one component
- [This] (https://github.com/pliablepixels/medfolio/blob/master/src/pages/medicalrecord/medicalrecord.module.ts) is how I use the same pipe in another component (well, in my linked example, its another pipe, but it can well be the same pipe)
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
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!