It seems to me that since http requests are made asynchronously, you cannot 
'call' this interceptor yourself, and so you cannot pass parameters to it.
But you could use another factory for configuring the current value of the 
header.
Please see the code for this 
plunk: http://plnkr.co/edit/nxIZgpqlCStzHtxUWN9R
I know this is fragile since it doesn't guarantee a certain value at a 
certain point in time, but if different parts of the Angular app do not 
need to set different tokens, it should work fine.

Also, you can always pass a header value when calling $http (without the 
use of 
interceptors): 
http://docs.angularjs.org/api/ng.$http#description_setting-http-headers

Please let me know if it's helpful.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to