angular2:错误:(62,33)TS2339:类型'typeof Injector'上不存在属性'resolveAndCreate'

时间:2016-05-04 20:28:25

标签: angular

自从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

肖恩

1 个答案:

答案 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);