I have two modules - let's call them module-E and module-P. I have one service in module-E say service-E which has multiple methods. I want to use all the functionality of service-E in module-P except for a few functions so I have extended service-P from service-E and have overridden those functions in service-P.
In module-E the provider declaration is
providers: [service-E]
In module-P the provider declaration is
providers: [{provide: service-E, useClass: servie-P}]
The problem is if I load module-P first, I get service-P even in module-E and if I load module-E first then I get service-E in module-P.
I want to restrict service-P to module-P and service-E to module-E no matter what.