I am considering to add a default header for the $http service, which value is an access token that will be generated after user authentification.
module.config('$routeProvider', '$locationProvider', '$httpProvider'){
$httpProvider.defaults.headers.post['XSRF-AUTH'] =
"some accessToken to be generated later";
}
Problem is, the config()
block is applied when Angular bootstraps its core components. Is there a way to alter $ĥttpProvider
dynamically ?