The way I injected the Http service is by adding
viewInjector: [httpInjectables]
in my top-level root component that is created using bootstrap(). EG,
import {Component, View, bootstrap, httpInjectables} from "angular2/angular2";
@Component({
selector: "litebrite-app",
// Pre-register application-wide services
// See
http://victorsavkin.com/post/118372404541/the-core-concepts-of-angular-2
viewInjector: [httpInjectables, EchoService, UserInfo]
})
@View({
templateUrl: "ui/app/appA2.html",
directives: [MainAreaCmpA2, BannerCmp]
})
class AppCmpA2 extends AppCmpBaseA2
{
...
}
bootstrap(AppCmpA2);
--
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.