Angular2 viewContainerRef.createComponent work correctly
i used viewContainerRef.createComponent to load dynamic component into root component(.....) ,but actual it append the wrong place, my code: -----app.compoment.ts----- export class AppComponent { private viewContainerRef:ViewContainerRef; public constructor(viewContainerRef:ViewContainerRef) { this.viewContainerRef = viewContainerRef; } } -----a.service.ts------ @Injectable() export class ModalService { private viewContainerRef:ViewContainerRef; constructor(applicationRef: ApplicationRef, injector: Injector,private compiler: ComponentResolver) { var classOfRootComponent = applicationRef