I am starting to use Angular 2 with ES5 and I hit a brick wall when setting up my providers. Essentially, I want the provider to depend on HTTP. Here's how I set it up:
var Provider = ng.core.Class({
constructor: [ng.http.Http, function(http) {
}]
});
var Component = ng.core.Component({
providers: [Provider, ng.http.HTTP_PROVIDERS]
}).Class({
constructor: [Provider, function(provider) {
}]
});
I keep getting the following error: No provider for t! (e -> t)
I skipped the rest of the template code because it was here that I was stuck. Do I have a misunderstanding about how I add my dependencies? How to set up hierarchical dependencies in Angular 2 in ES5?
source
share