Hi

Promise seems the most difficult part of Angular :(((

app.factory('SharedHomePageURL', function (SharedData, $q) {
var homePageUrl = SharedData.then(function(service) {
//console.log(service.homePageUrl); //return home
return service.homePageUrl
})
var p = $q.defer()
p.resolve({homePageUrl});
return p.promise
})


return a promise

How can I get the promise value?

SharedHomePageURL.then(function(response) {
console.log(response);

return:

Object {homePageUrl: Promise}
homePageUrl: Promise
$$state: Object
status: 1
value: "home"

and I just need home from value: "home"

Regards
Greg

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to