Skip to content

Instantly share code, notes, and snippets.

View hatemcode's full-sized avatar
🎯
Focusing

Hatem Al Amri hatemcode

🎯
Focusing
View GitHub Profile
@bettysteger
bettysteger / config.js
Last active August 27, 2018 06:24
Angular $httpProvider interceptor to handle requests and also cancels request on state change
/**
* This array is needed for canceling requests when changing the state/route.
* @type {Array}
*/
var currentRequests = [];
/**
* Handles route changes.
*/
app.run(['$rootScope', function($rootScope) {