Having trouble returning a usable string from the function below?
Here is the code:
app.factory('Urls', ['$http', function($http) {
var urls = {};
urls.getUrls = function () {
return $http.get('json/dataUrls.json');
}
return urls
}]);
app.factory('Emails', ['$http', 'Urls', function($http, Urls) {
var dataUrl = Urls.getUrls().then(function(response) {
return response.data.emails;
});
console.log(dataUrl);
var query = {};
query.getItems = function() {
return $http.get('json/emails.json');
};
return query;
}]);
The result of console.log(dataUrl);
shown below does not provide the desired value as a string...
f {$$state: {…}}
$$state
:
status
:
1
value
:
"json/emails.json"
__proto__
:
Object
__proto__
:
Object