import {
Directive,
ElementRef,
Input,
ViewContainerRef,
ComponentRef,
Component,
Renderer
} from '@angular/core';
@Component({
selector: 'test',
template: `
`
})
export class TestComponent {
private hostprop = 'clicked it';
public someValue = 1;
clicked() {
console.log(this.hostprop);
}
ngOnInit() {
const outerScope = this;
setInterval(function(){
outerScope.someValue++;
console.log(outerScope.someValue);
}, 3000);
}
}
@Component({
selector: 'app',
template: `
`
})
export class AppComponent {
private testComponent = TestComponent;
private template1 = `the new template1{{someValue}}
`;
private template2 = `the newer template
`;
}