title: add a class to the ui-view based on the current state
body: <p>In a AngularJS (1.2.7) project, using UI Router (0.2.8), I want to apply the current state as a class to the ui-view element, because that would allow me to apply animations for specific states, e.g. do transition A going from login to start and do transition B going from start to settings.</p>
  
  <p>At the moment I have the $state object on the $rootScope (as <a href="https://github.com/angular-ui/ui-router/issues/561" rel="nofollow">mentioned here</a>, which allows me to add a state-based class on the body using ng-class="$state.current.name". However, if I add that to the ui-view element, e.g. </p>
  
  <pre><code>&lt;div ui-view ng-class="$state.current.name"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Then the class is one step behind the actual state. So when going from "login" to "start", the class will be "login" instead of "start".</p>