Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular2: Error:(62, 33) TS2339: Property 'resolveAndCreate' does not exist on type 'typeof Injector'

Tags:

angular

Ever since ng2 beta 17 I get: Error:(62, 33) TS2339: Property 'resolveAndCreate' does not exist on type 'typeof Injector'.

  var injector = Injector.resolveAndCreate(
        [
            TodoService,
            TodoAction,
            HTTP_PROVIDERS,
            TodoStatsModel,
            provide(CommBroker, {useClass: CommBroker}),
            provide(AppStore, {useValue: this.appStore})
        ]);

I can't find an example of how to fix. Any help is appreciated

regadrs

Sean

like image 249
born2net Avatar asked May 04 '16 20:05

born2net


1 Answers

found it:

var injector = ReflectiveInjector.resolveAndCreate(
        [
            TodoService,
            TodoAction,
            HTTP_PROVIDERS,
            TodoStatsModel,
            provide(CommBroker, {useClass: CommBroker}),
            provide(AppStore, {useValue: this.appStore})
        ]);
    this.service = injector.get(TodoService);
like image 150
born2net Avatar answered Sep 26 '22 18:09

born2net