自从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
肖恩
找到了:
原文链接:https://www.f2er.com/angularjs/141335.htmlvar injector = ReflectiveInjector.resolveAndCreate( [ TodoService,{useValue: this.appStore}) ]); this.service = injector.get(TodoService);