2

Could you please suggest a way or point to a directive that fires an event on size updates of a HTML element in Angular 2?

The following approach

@HostListener('window:resize') onResize() 

fires only when the browser window or frame resizes, while I need instead to catch a div resizing.

I am looking for a non-polling based solution. Thank you in advance.

  • Have a look at that post. It's not angular but you might be able to reuse it. https://stackoverflow.com/questions/6492683/how-to-detect-divs-dimension-changed. Otherwise, see here for angular https://stackoverflow.com/questions/36695888/angular2-change-detection-on-resize-div – David Feb 06 '18 at 21:17

0 Answers0