Why can't I subsribe to resize event?


I have a dom element named domNode. I tried to subscribe it to resize event using the following code

@domNode.addEventListener 'resize', @callback

In Developer tools, I can see domNode element to be subscribed to resize event, but callback is never called.

is it that the resize event is triggered only in special situations?


I found the solution
Instead of adding event listener to domNode
I used
window.onresize = @callback

it worked