javascript - Abort HTTP request when redirect -
i got page uses angular , when page loaded, requests data http call. problem if user navigates other page while http call going on, system gives error , gives me http error callback showing alert "error".
$http.get('/api/something/).success(function (data, status, headers, config) { alert(data); }).error(function (data, status, headers, config) { alert('error'); });
what want instead abort http call , move user other page without error function being called.
so far found this.
but can't see how can use fix problem.
Comments
Post a Comment