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

前端之家收集整理的这篇文章主要介绍了angular2:错误:(62,33)TS2339:类型’typeof Injector’上不存在属性’resolveAndCreate’前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
自从ng2 beta 17我得到:错误:(62,33)TS2339:属性’resolveAndCreate’在类型’typeof Injector’上不存在.
  1. var injector = Injector.resolveAndCreate(
  2. [
  3. TodoService,TodoAction,HTTP_PROVIDERS,TodoStatsModel,provide(CommBroker,{useClass: CommBroker}),provide(AppStore,{useValue: this.appStore})
  4. ]);

我找不到如何修复的例子.任何帮助表示赞赏

regadrs

肖恩

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

猜你在找的Angularjs相关文章