I am having some issues getting the function below to return as a usable string?
my code is this:
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; }]);
below is the result of console.log(dataUrl);
what i am trying to get is the value string...
f {$$state: {…}} $$state : status : 1 value : "json/emails.json" __proto__ : Object __proto__ : Object
JSON.stringify(dataUrl)
to convert object to string