Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    A controller is a function. Put code directly in that function, and it will be executed when the controller function is called by angular. Commented Dec 2, 2016 at 14:41
  • Angular functions will execute asynchronously. I want to run a particular function after all the other functions completes execution. Commented Dec 2, 2016 at 15:53
  • You really, really need to clarify your question. First you talk about window.onload. Then you say "after my controller loads". Then you say "after all the other functions completes execution", bu wothout saying what those other functions are. What are you trying to achieve, at a higher level? What would you like your controller to do? Commented Dec 2, 2016 at 16:01
  • window.onload will execute after page loads completely. So i wanted to use window.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. Commented Dec 2, 2016 at 16:18