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

前端之家收集整理的这篇文章主要介绍了angular2:错误:(62,33)TS2339:类型’typeof Injector’上不存在属性’resolveAndCreate’前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
自从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

肖恩

找到了:
var injector = ReflectiveInjector.resolveAndCreate(
        [
            TodoService,{useValue: this.appStore})
        ]);
    this.service = injector.get(TodoService);

猜你在找的Angularjs相关文章