Skip to content

Instantly share code, notes, and snippets.

@HelenaEksler
Created January 5, 2016 09:14
Show Gist options
  • Save HelenaEksler/26da0ce031c1e7a1f535 to your computer and use it in GitHub Desktop.
Save HelenaEksler/26da0ce031c1e7a1f535 to your computer and use it in GitHub Desktop.
Add debug into Angular app.
$httpProvider.interceptors.push(function ($q, Auth, localStorageService, $injector) {
return {
'request': function (config) {
var concatWith = /\?/.test(config.url) ? '&' : '?';
if (config.url != 'template/pagination/pagination.html') {
config.url += concatWith + 'XDEBUG_SESSION_START=14394';
}
if (!config.url.match(/login-token/)) {
config.headers = {
'access-token': localStorageService.get('access_token')
};
}
return config;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment