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

test component

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

the new template1{{someValue}}

`; private template2 = `

the newer template

`; }