My Canvas is only taking full width, but not full height. Here's my code snippet in an attempt to make it both full width and full height:
export class AimComponent implements OnInit {
@ViewChild('canvas') myCanvas: ElementRef;
public context: CanvasRenderingContext2D;
ngOnInit() {
this.ngViewInit();
}
ngViewInit(){
this.context =
(<HTMLCanvasElement>this.myCanvas.nativeElement).getContext('2d');
this.draw();
}
draw() {
this.myCanvas.nativeElement.width = document.body.clientWidth;
this.myCanvas.nativeElement.height = document.body.clientHeight;
}
}