title: How to kill/destroy the Pending Http Request before hitting the same API Again in Angular Js?
body: <pre><code>.service('searchService', function ($http, $state) {
      getSearchResult: function (query) {
              return $http.get('/api/search/' + query + '/simple_search.json');
            }
  });
  </code></pre>
  
  <p>What I need to do is destroy all the pending search request so that when a new keyword is entered only 1 request stays in process. Right now when my server is getting slow multiple http request stays in pending state so I just want to cancel the previous request each time a new request is initiated.</p>
  
  <p>*This is required for handling multiple requests.</p>