How to convert
HTML
<a-entity id="fading-cube" geometry="primitive: box" material="opacity: 1">
<a-animation attribute="material.opacity" begin="fade" to="0"></a-animation>
</a-entity>
JS
document.querySelector('#fading-cube').emit('fade');
This is my code in Angular 2 that is not working.
@ViewChild('fading-cube') fadingCubeInput: any;
fadecube(){
this.renderer.setProperty(this.fadingCubeInput.nativeElement,'emit',"fade")
}