I'm facing the problem on passing the argument from controller to service module
I don't know where I have pass the arguments in controller module and how to get the value in service module. here is my code,
Controller module
var user = $scope.username;
var pass = $scope.password;
*// how to pass the username and password here*
checkStatus.query(function(response, headers) {
alert(headers('X-Internal-Auth-Toketn'));
});
Service module
UIAppResource.factory('checkStatus', function($resource) {
var auth = Base64.encode("abcd:abcd"); // *I need username and password here*
return $resource(baseURL + "status", {},
{
'query': {
method: 'GET',
headers: {
'Accept':'application/json',
'Content-Type':'application/json',
'Authorization': 'Basic '+ auth,
'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
},
isArray: false
}
}
)
});
I'm new for angularjs, please help me to solve this problem
Thanks in advance