How to load data when it's first needed and keep it to use in other places
<p>In my Angular SPA, there's some data loaded from the backend that is used throughout the application. This data doesn't change while the app is in use, so to keep things slick for the users I'd like to only load this data once. I can see two possible solutions here:</p>

<p>Load the data when the app is first initialised and attaching it to <code>$rootScope</code> using <code>angular.module.run()</code></p>

<p>or</p>

<p>The first controller to need the data loads it, and then puts it... <em>somewhere</em>... where everything else can get to it.</p>

<p>Which approach is the "most Angular" way to do this, and how would I start to implement it? Most of the questions on SO seem to be about loading data with the controller rather than when the app itself starts. I'm using 1.4.7 with UI Router if that makes a difference.</p>