title: How to change ng-src of an image on click
body: <p>I'm trying to change the ng-src of a repeating list of images I have per album. I tried doing something janky by just increasing the size of the thumnail url but I would like a more concrete method of swapping the ng-src of my imgs to the larger url for the image. Here's my code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
      &lt;head&gt;
          &lt;script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="album.js"&gt;&lt;/script&gt;
          &lt;link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"&gt;
          &lt;link rel="stylesheet" href="album.css"&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;div ng-app="myApp" ng-controller="AlbumCtrl"&gt;
              &lt;div class="bar"&gt;
                  &lt;h3&gt;Search by ID or Title&lt;/h3&gt;&lt;input type="text" class="search" ng-model="q" placeholder="Enter your search terms" /&gt;
              &lt;/div&gt;
              &lt;div ng-repeat="album in albumData|filter:q" id="thumbWrapper"&gt;
                  &lt;h1&gt;{{album.id}}&lt;/h1&gt; 
                  &lt;h4&gt;Title: &lt;/h4&gt;&lt;button class="show" ng-click="showme = !showme"&gt;{{album.title}}&lt;/button&gt;
                  &lt;div id="thumbList"ng-show="showme"class="albumContent"&gt;
                      &lt;ul ng-controller="PhotoCtrl" id="thumbList"&gt;
                          &lt;li ng-repeat="photo in photoData" ng-if="album.userId == photo.albumId"&gt;
                              &lt;img id="view{{$index}}" ng-click="zoom($index)" ng-src={{photo.url}}&gt;
                              &lt;p ng-click="delete($index)"&gt;x&lt;/p&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>js: </p>
  
  <pre><code>var app = angular.module('myApp', []);
  app.controller('AlbumCtrl', function ($scope, $http) {
      $http.get("https://jsonplaceholder.typicode.com/albums").then(function(response) {
          $scope.albumData = response.data;
          console.log($scope.albumData);
      });
  });
  app.controller('PhotoCtrl', function($scope, $http) {
      $http.get("https://jsonplaceholder.typicode.com/photos").then(function(response) {
          $scope.photoData = response.data;
  
      });
      $scope.delete = function(index) {
  
          $scope.photoData.splice(index, 1);
  
          var del = "/" + (index + 1);
          $http.delete("https://jsonplaceholder.typicode.com/photos" + del).then(function(response) {
              console.log($scope.albumData);
          });
      };
  
      $scope.zoom = function(index) {
          var elem = "view" + index;
          var imageId = document.getElementById(elem);
          if(imageId.style.width == "1000px"){
          imageId.style.width = "600px";
          imageId.style.height = "600px";
          }else{
          imageId.style.width = "1000px";
          imageId.style.height = "1000px";  
          }
      };
  
  });
  </code></pre>
  
  <p>any help is much appreciated I'm trying to learn all about $http requests and utilizing json with angular</p>