I'm having a hard time here with ngClass as I'm new to angular. I've got a table set up that generates rows dynamically from a database using ng-repeat, with span and input elements that hide/show based on editing/not editing the cell (imagine microsoft excel).

```
<tr>
  <th class="row_head">Row Title</th>
  <td ng-click="edit = true" ng-repeat="item1 in JSONobject | orderBy: '_id'" >
     <span ng-hide="edit">{{ item1.key.value1 }}</span>
     <input ng-show="edit" class="editing-cell" ng-model="item1.key.value1" ng-blur="edit = false; " ng-enter="saveData(item1._id, item1.key); edit = false" type="text" />
  </td>
</tr>

<tr>
  <th class="row_head">Row Title</th>
  <td ng-click="edit = true" ng-repeat="item2 in JSONobject | orderBy: '_id'" >
     <span ng-hide="edit">{{ item2.key.value2 }}</span>
     <input ng-show="edit" class="editing-cell" ng-model="item2.key.value2" ng-blur="edit = false; " ng-enter="saveData(item2._id, item2.key); edit = false" type="text" />
  </td>
</tr>

```

and so on. 

I want to set it so on blur (data not saved) the cell turns red, and alternatively on save - turns green.

The issue i'm running into with ngClass is if i just go with:

```
ng-class="{'saved': saved, 'notSaved': notSaved}"

```

It changes the background color of EVERY cell, rather than just the cell edited. 

I do not have this issue with ng-hide and ng-show, even though they appear to be a similar scenario with changing the boolean value of 'edit'. They still stick to their specific cell.

Any help would be appreciated.