title: How to get angular js $http.delete request working in image app
body: <p>Hi I have an image album app thats getting data from jsonplaceholder.com</p>
  
  <p>I coded up a $http.delete() method but it doesn't seem to be deleting photos by the index provided</p>
  
  <p>heres the html: </p>
  
  <pre><code>        &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.thumbnailUrl}}&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>and the 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) {
  
          var del = "/" + (index + 1);
          $http.delete("https://jsonplaceholder.typicode.com/photos" + del).then(function(response) {
              console.log($scope.albumData);
          });
      };
  </code></pre>
  
  <p>any help would be awesome! :)</p>