I need to call a function after a fully loaded page (like window.onload
) but this event is not trigger if I change the view.
I tried to call the function in my controller (which is trigger when the view change) but the function work only at half (my function need to make some change in the DOM after that the ng-model wrote values in the input fileds).
I would like to know if I can make a condition like 'call me that function after that the ng-model had done his job'...
Exemple :
// Case 1 //
// It works perfectly but not on viewChange.
window.onload = function() {
// My stuff...
}
// Case 2 //
function onLoadView() {
// My stuff...
}
// In my controller it is always call but sooner than expected
onLoadView();
// Case 3 //
function onLoadView() {
window.onload = function() {
// My stuff...
}
}
// In my controller, the window.onload is not trigger
onLoadView();
Thanks for the help folks !