app.run is supposed to be Angular's silbling to a Java main function. But is it mandatory or optional?
See also: AngularJS app.run() documentation?
app.run is supposed to be Angular's silbling to a Java main function. But is it mandatory or optional?
See also: AngularJS app.run() documentation?
It is optional. Run blocks are effectively used for tasks that need to run before any other part of the app is injected or instantiated. If you don't have any of those requirements, you don't need a run block :)
Source - I've maybe written one, maybe two, run blocks for the multitude of angular projects I've worked on.
Edit: Run blocks won't run before EVERYTHING, they will run after config and service instantiation. Thanks to the comment below for pointing that out.