Answers for "get angular width"

0

get angular width

// to get it on init:
public innerWidth: any;
ngOnInit() {
    this.innerWidth = window.innerWidth;
}

// if you wanna keep it updated on resize:
@HostListener('window:resize', ['$event'])
onResize(event: any) {
  this.innerWidth = window.innerWidth;
}
Posted by: Guest on February-09-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language