title: Angularjs toggle image onclick
body: <p>I'm trying to toggle a button image when a user clicks it.  I prefer to use angularjs instead of jquery if possible.  Right now I have a working version which toggles the image when clicked, the only problem is it changes ALL the images on click.  How do I reduce the scope or pass in the src attribute for the img element?</p>
  
  <pre><code>    &lt;div ng-repeat="merchant in merchants"&gt;
        &lt;div class="followrow"&gt;
          &lt;a ng-click="toggleImage()"&gt;&lt;img id="followbutton" ng-src="{{followBtnImgUrl}}"  /&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
  app.controller('FollowCtrl', function CouponCtrl($scope) {
      $scope.followBtnImgUrl = '/img1'
  
  
      $scope.toggleImage = function () {
          if ($scope.followBtnImgUrl === '/img1.jpg') {
              $scope.followBtnImgUrl = baseUrl + '/img2.jpg';
          } else {
              $scope.followBtnImgUrl = 'img1.jpg';
          }
      }
  });
  </code></pre>
  
  <p>Can I pass in the img src attribute the function like toggleImage(this.img.src) or similar?</p>