Map service response paremeter to global scope variable?
How can I map the response parameter from a server code API call to a global scope variable?
1) I have setup the variable on the index page (auth,auth)
2) I have created a model, which a child variable (auth,token)
3) I am trying to set this global variable via a response parameter, like this:
$scope.auth.token = requestData.params.token;
But when i try and check if the variable exists on a different page, via this:
alert($scope.auth.token);
It says it is undefined?
The response is being returned as JSON
Whats the correct way to map the response parameter to the global scope variable?
Thanks