how to use cookiesProvider in angular config
I wanted to set specific http headers on every http request, so this is my solution:
I'm using the run function because in config I couldn't access cookies, see http://docs.angularjs.org/guide/module
app.run(function run( $http, $cookies ){ $http.defaults.headers.common["X-AUTH-TOKEN"] = $cookies['AUTH-TOKEN'];});
If you don't want to use the run function for that configuration (because it's hard to unit-test), you can write an interceptor for the $httpProvider, similar to this: https://gist.github.com/lpsBetty/76df8d1f037db87f4a0b