.service('searchService', function ($http, $state) {
getSearchResult: function (query) {
return $http.get('/api/search/' + query + '/simple_search.json');
}
});
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.
*This is required for handling multiple requests.