How to call function when user navigates to page


I am having some trouble in the following case: I have a profile page that lists the user profile. The user can click an edit button to edit all user related information. Once the user saved the page, they navigate back to the profile page that should ideally be updated automatically.

Now I am missing kind of an event that triggers, when a user navigates to a page. window.onLoad() does only work once, same for window.onPageShow(). window.onPopState() is triggered when the user goes away from the page.

My idea was to rely on such an event, then call $scope.init() which downloads the user information and sets it to the view.

Thanks for any hints!

Maybe this will help?

1 Like