I have an angular application that is hitting a node API. Our backend developer has implemented basic auth on the API, and I need to send an auth header in my request.
You can use it in the controller:
.controller('Controller Name', ['$http', function($http) { $http.defaults.headers.common['Authorization'] = 'Basic ' + login + ':' + password; }]);