import { Directive, ElementRef, Input, Injector, ApplicationRef, ViewContainerRef, ComponentRef, Component, Renderer } from '@angular/core'; @Component({ selector: 'test', template: `

test component

` }) export class TestComponent { private hostprop = 'clicked it'; public someValue = 1; constructor( private vcRef: ViewContainerRef, ) { console.log('pc'); console.log(this.vcRef); } clicked() { console.log(this.hostprop); console.log(this.vcRef); } ngOnInit() { const outerScope = this; setInterval(function(){ outerScope.someValue++; }, 3000); } } @Component({ selector: 'app', template: `
` }) export class AppComponent { private testComponent = TestComponent; private componentDeps = [ViewContainerRef]; private template1 = `

the new template1{{someValue}}

`; private template2 = `

the newer template

`; constructor( private injector: Injector, ) { } }