自从ng2 beta 17以来我得到:错误:(62,33)TS2339:属性'resolveAndCreate'在类型'typeof Injector'上不存在。
var injector = Injector.resolveAndCreate(
[
TodoService,
TodoAction,
HTTP_PROVIDERS,
TodoStatsModel,
provide(CommBroker, {useClass: CommBroker}),
provide(AppStore, {useValue: this.appStore})
]);
我找不到如何解决的例子。任何帮助表示赞赏
regadrs
肖恩
答案 0 :(得分:13)
var injector = ReflectiveInjector.resolveAndCreate(
[
TodoService,
TodoAction,
HTTP_PROVIDERS,
TodoStatsModel,
provide(CommBroker, {useClass: CommBroker}),
provide(AppStore, {useValue: this.appStore})
]);
this.service = injector.get(TodoService);