title: Conditionally set Angular's ng-class based on state
body: <p>I would like to conditionally set the class of an element based on the application state (using AngularUI Router). I've tried this, but it is not working:</p>
  
  <pre><code>&lt;li ng-class="{active: $state.current.name === 'state1'}"&gt;State 1&lt;/li&gt;
  &lt;li ng-class="{active: $state.current.name === 'state2'}"&gt;State 2&lt;/li&gt;
  </code></pre>
  
  <p>Any ideas?</p>