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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -