TypeScript sur la fenêtre redimensionne
@HostListener('window:resize', ['$event'])
onResize(event) {
event.target.innerWidth;
}
Precious Polecat
@HostListener('window:resize', ['$event'])
onResize(event) {
event.target.innerWidth;
}
resizeObservable$: Observable<Event>
resizeSubscription$: Subscription
ngOnInit() {
this.resizeObservable$ = fromEvent(window, 'resize')
this.resizeSubscription$ = this.resizeObservable$.subscribe( evt => {
console.log('event: ', evt)
})
}