title: Run once when AngularJS controller loads
body: <p>I have some stuff that needs to be done only once when the controller is loaded. What's the best way to this? I've read some about the "run block" but I don't really understand how it works. </p>
  
  <p>Some pseudo code:</p>
  
  <pre><code>when /app
  resolove some stuff
  load a view
  controllerA
  
  ControllerA:
  
  Some-magic-piece-of-code-only-run-once{
   }
  </code></pre>
  
  <p>Can anyone point me in the right direction?</p>