I have the following Component:
import {Component, OnInit} from 'angular2/core';
@Component({
selector: 'test',
template: `{{renderer.domElement}}`
})
export class TestComponent implements OnInit {
renderer;
ngOnInit() {
this.renderer = new THREE.WebGLRenderer();
this.renderer.setSize(300, 300);
//document.body.appendChild(this.renderer.domElement);
}
}
The {{}} property binding doesn't bind the DOM element to template. Using appendChild doesn't make the DOM up-to-date with the "renderer" variable. The only way I can think of is to read the text content of the DOM element and bind it, but I guess it's not the best approach. How should I do it?