How to use window.onload
function inside a controller.
window.onload= function() {
console.log("Hi Page loaded")
};
The controller is not applicable for the full page. I want to execute a function after my controller loads at-least.
How to use
The controller is not applicable for the full page. I want to execute a function after my controller loads at-least. |
|||
You can use ng-init and invoke your necessary function using the same directive
|
||||
|
Changing the example from Angular $window Your Controller
Your markup
|
|||
|
window.onload
will execute after page loads completely. So i wanted to usewindow.onload
in my code. But my application is loading within another page. So the controller which i wrote is not for the full page. Thats why window.onload is not working. So alternate option i have is execute a function after all other function completes execution. – Santosh Hegde 21 hours ago