Below code lets observe any size change for any given div in Angular.
<div #observed-div></div>
then in the Component:
oldWidth = 0;oldHeight = 0;@ViewChild('observed-div') myDiv: ElementRef;ngAfterViewChecked() { const newWidth = this.myDiv.nativeElement.offsetWidth; const newHeight = this.myDiv.nativeElement.offsetHeight; if (this.oldWidth !== newWidth || this.oldHeight !== newHeight) console.log('resized!'); this.oldWidth = newWidth; this.oldHeight = newHeight;}