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

test component

` }) export class TestComponent { private hostprop = 'clicked it'; clicked() { console.log(this.hostprop); } } @Component({ selector: 'app', template: `
` }) export class AppComponent { private testComponent = TestComponent; private template1 = `

the new template

`; private template2 = `

the newer template

`; }