Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

Event when page is resized, loaded or shown

Hi,

Code: Select all

Is there any way in Angular Js of listening an event when page is resized, loaded or shown?  I need to get the window(page) width and height when it's resized. 

Thank you

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Event when page is resized, loaded or shown

Hello,

You can add a watcher to the $scope variable to "listen" it's changes. That function will be triggered if that variable changes

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

Event when page is resized, loaded or shown

Hello, Sergiy, thank you for your fast return. Do you have a small sample showing how to do this?

Thank you

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Event when page is resized, loaded or shown

We don't have such example, because this is default AngularJS functionality. Please look at this link how to use watchers here: https://docs.angularjs.org/api/ng/typ...

Return to “Issues”