How and where is app.run()
used? After module definition, after app.config()
or after app.controller()
?
I am adopting the BreezeJS Angular Q, which asks whether certain code can be run in the app.run()
function.
How and where is app.run()
used? After module definition, after app.config()
or after app.controller()
?
I am adopting the BreezeJS Angular Q, which asks whether certain code can be run in the app.run()
function.
Here's the calling order:
app.config()
app.run()
app.controller()
Here's a simple demo where you can watch each one executing (and experiment if you'd like).
From Angular's module docs:
One situation where run blocks are used is during authentications.
Specifically...
Where:
In your package.js E.g.
/packages/dashboard/public/controllers/dashboard.js
How:
Make it look like this