New to Angular but I am learning. What my goal is: I have a login view that passes a user object to our API, API checks it against user database and reposnds with Base64 conversion of username and password. I have Also setup a page that returns some simple JSON if the user passes Authorization : Base ... as a header they will receive the data. If not it responds 401 and I set up a global 401 handler to route back to "/login".
My issue is that in my LoginService I receive the Base64 key and I can alert it out to show that I received it. But I get an "undefined" if I inject this service into my json page as a header like so..
$http.get('http://myURL/api/project', { headers: {"Authorization": "Basic " + userLoginService.myData}})
So the basic thing I am trying to do is pass data from one SERVICE to another SERVICE, I have seen how to do this from one CONTROLLER to another but, I am not sure what to do here. Any sample code would obviously be great. Thanks a lot in advance.