1
votes

I have one sharedmodule which exports differnt modules, components and pipes to the rest of the modules in the application.

This works quite well, BUT(!!!) I have the problem I can't get my head around.

I have a module which uses a pipe which is declarated in the shared module. The module is imported in the sharedmodule.

sharedmodule:

imports: [
moduleOne
],
declarations:[
pipeShared
],
exports:[
moduleOne
pipeShared
]

Now I cant declare the Pipe in moduleOne, but also can't import sharedModule in moduleOne.

1
are you trying to use the pipe in the template or in a component ? Cause in the second case you will have to provide you pipe in the feature modulePierre Mallet
It sounds like you are creating a circular dependency ... sharedmodule imports moduleOne and moduleOne imports sharedmodule. Instead, try removing moduleOne from the sharedmodule. You can then pull in moduleOne separately where you need it. Or build a second module that imports both moduleOne and sharedModule that you can then share. Make sense?DeborahK

1 Answers

1
votes

as i know, there is no way to use a component/pipe from a module where im important e.g. Module A, Module B. Module A provides pipies. Module B is important ind Module A. Module B can´t use pipes from Module A. I think you need to create a "shared" module.