title: How do I change the class of each individual div in a series of divs when clicked on?
body: <p>I am trying to change the class of an individual div when it is clicked on and what I have is not working. I'm having trouble understanding how ng-click and ng-class work together so that is why I'm having trouble figuring this out. What do I need to do or put inside my changeBackground function so that individual div will have a class applied?</p>
  
  <pre><code>&lt;div ng-controller="BoardController"&gt;
      &lt;div class="rows" ng-repeat="r in rows track by $index" ng-click="changeBackground($index)" ng-class="{ red: }"&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  
  $scope.changeBackground = function(index) {
  
  };
  </code></pre>