@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
title = 'ang12';
ngOnInit(): void {
//const container = document.createElement('div')
const container = document.getElementById("canvas1");
document.body.appendChild(container)
container.appendChild(renderer.domElement)
animate()
}
}
The code above the @Component block contains my three.js implementation, which is currently rendering on the entire screen. I am looking to display it within a canvas element and manipulate its positioning. Even though I have correctly utilized div tags in app.component.html, simply modifying the div style did not yield the desired result.
ngOnInit(): void {
const container = document.createElement('div')
container.style.width = "1000px"
container.style.top = '5000px';
document.body.appendChild(container)
container.appendChild(renderer.domElement)
animate()
}
}