title: Only add class to specific ng-repeat in AngularJS
body: <p>I have a Facebook style like system in my app and I want to make the like button change colour when the user clicks. This is to be done by adding an .active class, but I cant figure out how to get just the one item in my ng-repeat to have thr active class.</p>
  
  <p>Heres my view:</p>
  
  <pre><code>&lt;div class="list card" ng-repeat="data in array"&gt;
    &lt;div&gt;
      &lt;a ng-click="favourite(data.ID)" class="tab-item" &gt;
        &lt;i ng-class="{'active':  favourited}" class="icon ion-thumbsup" &gt;&lt;/i&gt;
        Favourite
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The ng-click sends the request to the server to store in the database, and the ng-class changes the class to active when the "favourite" variable from the controller changes to true once this request is sucesfull:</p>
  
  <pre><code>$scope.favourite = function(dataID){
      $favourite.favourite(dataID).then(function(data){
        $scope.favourited = true;
      });
    }
  </code></pre>
  
  <p>This causes all of the favourite buttons to become active, so I just dont know how to make just the current button active. </p>
  
  <p>Thanks in advance</p>