title: Angularjs - Abort/cancel running $http calls
body: <p>I've got a call using Resource in angularjs but i get some problems because i can't abort every calls it does. This kind of structure i use for an autocomplete.. is it possible convert from resource call to http? This is the code</p>
  
  <pre><code>var Resource = $resource(URL, {},{ getAutocompleteResults: { method: "GET", params: {text: ""} }});
  
  var locked = false;
  function getMoreData() {
  
      if(locked)
          return;
      locked = true;
  
      Resource.autoCompleteResults()
          .$promise.then(function(data) {
              $scope.autocompleteViewResults = data;
              locked = false;
          });
  
  }
  </code></pre>
  
  <p>This is what i've tried so far with no success.</p>
  
  <pre><code>$scope.autocompleteViewResults = function () {
              $http
                  .get(URL, {
                      params: {
                          text = ""
                      }
                  })
                  .success(function (data) {
                      $scope.autocompleteViewResults = data;
                  });
          };
  </code></pre>
  
  <p>Or if someone knows an alternative method..</p>