Element height and width change detection in Angular 2 -


i looking solution, nothing found (only articles (window:resize), not looking for).

how detect element size change in angular 2?

<div #myelement (sizechanged)="callback()" /> 

i want use css animations , detect element's height , width changes.

the problem not angular 2 problem. more generally, how detect size changes in element other window? there onresize event, triggered window , there no other obvious solutions.

the general way many approach this, set interval of, say, 100ms , check width , height of div detect change. horrible sounds, common approach.

from this answer more general question, there library using events: http://marcj.github.io/css-element-queries/. supposedly, it's quite good. use resizesensor you're looking for.

unless of course, you're expecting div resize when window does. onresize you're looking for.


Comments

Popular posts from this blog

Formatting string according to pattern without regex in php -

c - zlib and gdi32 with OpenSSL? -

java - inputmismatch exception -