Module A
declarations: [myComponent]
providers: [myServiceA]
Module B
declarations: [myComponent]
providers: [myServiceB]
myComponent Shared by Module A and B
class myComponent {
constructor(?) {}
}
myServiceA and myServiceB share the same API. The idea is that myServiceA stores the data locally (lets say localstorage) and myServiceB stores the data on the remote server (lets say Firebase).
How do I inject the correct myService, based on the module the component is loaded from?