i want to do the following

function test(){

      var user = null;

      userFactory.get(userId).then(function(data){
          user = data;
          console.log(user);
      });

    return user;

}

this returns null while console.log print user object, how to i return user 
object gotten from get() promise

-- 
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/groups/opt_out.

Reply via email to