title: controller nto getting the return value of factory
body: <p>my controller gets {"$$state": {"status" :0 } } from the factory instead of the value that's supposed to be passed by the factory. how do i get the value from the factory? </p>
  
  <p>here is my controller.js code:</p>
  
  <pre><code>.controller('omnipayLoginCtrl', ['$scope', '$stateParams', '$location', 'userFactory', function ($scope, $stateParams, $location, userFactory) {
  $scope.userdata = {}
  $scope.enterlogin = function(usern,pass) {
     alert('get = '+ JSON.stringify(userFactory.getUser(usern)) );
  }
  }])
  </code></pre>
  
  <p>here is my services.js code:</p>
  
  <pre><code>.factory('userFactory', ['$http', function($http) {
  var users = [];
  
  return {
      getUser: function(uname){
           return $http.get("http://10.10.9.169/UserService/api/users/" + uname).then(function(response){
             if(response.data == null)
             {
                 users = null;
             }
             else
             {
                 users = response.data;
             }
             return users;
           });
          }
  
  };
  }])
  </code></pre>