title: AngularJS - Apply class to <td> based on ng-switch statement
body: <p>I have a simple ng-repeat on a <code>&lt;td&gt;</code>. Wihtin the ng-repeat is a ng-switch directive. I want to know how to apply a CSS class to a <code>&lt;td&gt;</code> when a a particular ng-switch condition is met.</p>
  
  <pre><code>&lt;td ng-repeat="deposit in MyData.MyDeposits.slice(0, 12)" ng-switch="deposit" ng-class="darkGrey: darkenCell == 1"&gt;
      &lt;span ng-switch-when="0"&gt;U&lt;/span&gt;
      &lt;span ng-switch-when="1"&gt;D&lt;/span&gt;
      &lt;span ng-switch-when="2"&gt;2&lt;/span&gt;
      &lt;span ng-switch-when="3"&gt;3&lt;/span&gt;
      &lt;span ng-switch-when="4"&gt;3&lt;/span&gt;
      &lt;span ng-switch-default ng-init="darkenCell = 1" &gt;Dark&lt;/span&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>However i am seeing the following error:</p>
  
  <pre><code>Error: [$parse:syntax] http://errors.angularjs.org/1.2.8/$parse/syntax?p0=%3A&amp;p1=is%20an%20unexpected%20token&amp;p2=6&amp;p3=darkGrey%3A%20darkenCell%20%3D%3D%201&amp;p4=%3A%20darkenCell%20%3D%3D%201
  </code></pre>