title: Angularjs ng-class not removing old values when property changes
body: <p>I have an angular app that is using an array to populate css rule sets in the view using ng-class. When the array is updated the new rule sets get applied to the DOM, but the old rule sets arent removed. </p>
  
  <p>Clicking on an item updates the array in my Controller which is only altered once in the initilization of the controller and added to the scope for the view to use</p>
  
  <pre><code>// generate an array of values, 1 for each item
          this.scope.valueList = [];
          for(var i in this.scope.items) {
              this.scope.valueList.push(this.generateValue(this.scope.items[i]));
          }
  </code></pre>
  
  <p>My html</p>
  
  <pre><code>&lt;div ng-repeat="item in valueList"&gt;
      &lt;div class="action" ng-class="item.type" focusable&gt;
      &lt;div class="image svg"  ng-class="item.icon" &gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have tried using the bindonce with bo-class plugin for angular so this weird update wouldnt occur, but still it persists </p>
  
  <p>The whole flow of javascript is doing great. Looking at the Arrays before and after going through this process shows its all working fine. I have used Chrome debugger and stepped through each process monitoring it every step of the way.</p>
  
  <p>The only problem is my ng-class is not erasing old values, it just adds on new ones. Refreshing the app fixes the duplicates problem and only displays the current value from the controllerArray</p>
  
  <p>Is there some caching mechanism going on or bug that keeps ng-class from removing old values when the value of a property its watching changes?</p>