title: AngularJS Factory adds $promise and $resolve to object but not sure how to resolve it correctly?
body: <p>I have a Factory in AngularJS, which serves as the bridge between my app and my back-end. When I try to add a DELETE function to my factory, it creates a weird URL which includes $promise and $resolved elements.</p>
  
  <p>This is my AngularJS code. Basically: I am not sure where the $promise and $resolve statements are coming from (they should come from the getById statement right?)</p>
  
  <p>This is the error:</p>
  
  <pre><code>DELETE http://localhost:8080/rest/speaker?$promise=%7B%7D&amp;$resolved=false  415 (Unsupported Media Type)  
  </code></pre>
  
  <p>1/ Controller</p>
  
  <pre><code>$scope.delete = function(id) {
  
      var speaker = SpeakerService.getById(id);
  
      SpeakerService.delete(speakerOrEmpty, function () {
          $log.log('saved at: ' + new Date());
          $route.reload();
      });
  
  };
  </code></pre>
  
  <p>2/ Service</p>
  
  <pre><code>this.getById = function (id, callback) {
      return SpeakerResource.get({speakerId: id}, callback);
  };
  
  this.delete = function (data, callback) {
      SpeakerResource.delete(data);
  }
  </code></pre>
  
  <p>3/ Factory/Resource</p>
  
  <pre><code>    {
          'delete': { method: 'DELETE' }
      })
  </code></pre>
  
  <p>What I have tried is to update my getById statement to this, but without success as I am still seeing the $resolved and $promise items in my DELETE request, although now they are set to TRUE.</p>
  
  <pre><code>DELETE http://localhost:8080/rest/speaker?$promise=%7B%7D&amp;$resolved=true&amp;id=5419e8…5c1cde009%22,%22name%22:%22x%22%7D&amp;organizationId=541a3eee772fb8f5c1cde009  415 (Unsupported Media Type)  
  
  $scope.delete = function(id) {
  
       var speakerOrEmpty = SpeakerService.getById(id, function (data) {
  
          speakerOrEmpty = data;
  
          SpeakerService.delete(data, function () {
              $log.log('saved at: ' + new Date());
              $route.reload();
          });
      });
  };
  </code></pre>
  
  <p>Thank you so much for any help. It is much appreciated.</p>