docs: ngComponentOutlet doc updated with new Injector creation (#27291)

PR Close #27291
This commit is contained in:
kwiateusz 2018-11-27 16:04:27 +01:00 committed by Andrew Kushnir
parent d6aca79410
commit 657cf733a2
1 changed files with 4 additions and 3 deletions

View File

@ -7,7 +7,7 @@
*/ */
import {CommonModule} from '@angular/common'; import {CommonModule} from '@angular/common';
import {Compiler, Component, Injectable, Injector, NgModule, NgModuleFactory, ReflectiveInjector} from '@angular/core'; import {Compiler, Component, Injectable, Injector, NgModule, NgModuleFactory} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser'; import {BrowserModule} from '@angular/platform-browser';
@ -56,7 +56,8 @@ class NgTemplateOutletCompleteExample {
myContent = [[document.createTextNode('Ahoj')], [document.createTextNode('Svet')]]; myContent = [[document.createTextNode('Ahoj')], [document.createTextNode('Svet')]];
constructor(injector: Injector) { constructor(injector: Injector) {
this.myInjector = ReflectiveInjector.resolveAndCreate([Greeter], injector); this.myInjector =
Injector.create({providers: [{provide: Greeter, deps: []}], parent: injector});
} }
} }
// #enddocregion // #enddocregion
@ -111,4 +112,4 @@ export class AppModule {
entryComponents: [OtherModuleComponent] entryComponents: [OtherModuleComponent]
}) })
export class OtherModule { export class OtherModule {
} }