I am working with a node js rest api. In the authentication process api returns an access token. I need to add the access token to every request from an common place.
You can use http interceptor
Code looks like as follow
$httpProvider.interceptors.push(function($q, $cookies) {
return {
'request': function(config) {
config.headers['Token'] = $cookies.loginTokenCookie;
return config;
}
};
});