Hi,
I have a question related to multi providers in angular2, i intend to use it in my project.
Suppose i have 3 modules , Root Module and two lazily loaded modules A and B. I have created token at root level.
I provide the respective classes in child modules as below :
For module A
{ provide: IServiceToken, useClass: AService}
For module B
{ provide: IServiceToken, useClass: BService}
This approach works fine.
However , what if i want to access methods from both AService and BService in Root,
i have written below code in root module
providers: [
{ provide: IServiceToken, useClass: AService, multi: true },
{ provide: IServiceToken, useClass: BService, multi: true },
]
The above doesnt seem to work, gives error Mixing multi and non multi provider is not possible for token.
Is anything wrong with aproach, or can any one tell me possible way of achieving it?
Thanks,
Tanu