title: Angular http returns $$state object
body: <p>I have the following factory defined:</p>
  
  <pre><code>angular.module("account").factory("users",["$http",
      function(a){
        return {
           getUser: function(){
              return a.get("/user/me").then(function(r){
                  return r.data;
              });
          }
      };
    }
  ]);
  </code></pre>
  
  <p>And my controller:</p>
  
  <pre><code>angular.module("test.controllers",["account"])
  .controller("TestCtrl",["$scope","users",
      function(a,u){
          a.user = u.getUser();
          console.log(a.user);
  }]);
  </code></pre>
  
  <p>Here's the console.log:</p>
  
  <pre><code> d {$$state: Object, then: function, catch: function, finally: function} $$state: Object status: 1 value: Object user: Object__v: 0 _id: "54c1fg29f36e117332000005" temp: "1ce3793175e0b2548fb9918385c2de09"  __proto__: Object __proto__: Object __proto__: Object __proto__: Object
  </code></pre>
  
  <p>The above code is returning a state object instead of the user object. 
  But from the log, the state object has the user object within value. How do i get the user object? Or am i doing this completely wrong?</p>
  
  <p>I know the other way is to return the $http.get and call the then() method within controller. But I'll be using the user object frequently and if i'm calling the then() method in controller, its almost same as using the $http.get in controller instead of the factory.</p>