I have an existing angularjs code which makes a HTTP GET. Extracted below is some relevant code inside the controller.
.controller('imptViewCtrl', ['$scope', '$http',
function ($scope, $http, ) {
var url = $configuration.webroot + '/impt/list?list=testlist';
$http.get(url).then(function (response) {
tableData = response.data;
});
}]);
I would like to add HTTP basic authentication to the HTTP GET. The username is foo
and the password is bar
. How can this be done?