Answers for "window resize in angular 7"

2

typescript on window resize

@HostListener('window:resize', ['$event'])
onResize(event) {
  event.target.innerWidth;
}
Posted by: Guest on November-02-2020
-1

div resize event typescript

resizeObservable$: Observable<Event>
resizeSubscription$: Subscription

ngOnInit() {
    this.resizeObservable$ = fromEvent(window, 'resize')
    this.resizeSubscription$ = this.resizeObservable$.subscribe( evt => {
      console.log('event: ', evt)
    })
}
Posted by: Guest on May-21-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language