Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #width
ADD COMMENT
Topic
Name
8+9 =