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

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to