I was wondering if anyone knew of an example where an Angular 2.0 service 
is injected into another service, where by service I mean an exported class 
which is *not* a @Component, and as a result, does not have access to the 
@Component({services[SomeClass]}) provider information (as far as I can 
figure out -- I tried a few combinations of adding items like @Component to 
the class, but never found a combination that worked).

Right now, the error I receive is as follows: 
*No provider for DispatcherService! (TodosComponent -> TodoStore -> 
DispatcherService)*

My structural setup is:

   1. app.js gets TodosComponent from 
   @Templates({directives[TodosComponent]})
   2. TodosComponent gets TodoStore from @Component({services:[TodoStore]}) 
   and constructor(store: TodoStore)
   3. TodoStore does *not* get DispatcherService from import 
   {DispatcherService} and constructor(dispatcher: DispatcherService) - the 
   error above is thrown


Everything is functional when I remove "dispatcher: DispatcherService" from 
the constructor definition of TodoStore. I can even initialize a new 
DispatcherService() from inside the TodoService constructor, but that sort 
of defeats the purpose of sharing a single instance of the dispatcher. :) I 
can also "cheat" by injecting DispatcherService with a different class 
(such as TodoStore), but this feels incorrect to me since my TodosComponent 
technically isn't utilizing the DispatcherService yet. 

Any direction would be greatly appreciated! Especially since I know the 
spec is constantly fluctuating. I am using the version of Angular 2.0 from 
the Angular quickstart code, and I can post my full code, if necessary.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" 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 http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to