title: Why I can't get object firebase from angular.js factory?
body: <p>I have factory </p>
  
  <pre><code>    o.getUserWorkout = function (_id) {
          if (_id){
              $firebaseArray(DBC.getRef().child('workouts')
                      .orderByChild('userID')
                      .equalTo(DBC.getAuthRef().$getAuth().uid)
              ).$loaded()
                  .then(function (x) {
                      console.log(x.$getRecord(_id))
                      return x.$getRecord(_id);
                  });
          }
      };
  </code></pre>
  
  <p>and controller</p>
  
  <pre><code>function workoutController($scope, workoutFct, $state) {
      $scope.editUserWorkout = function (_id) {
          console.log(workoutFct.getUserWorkout(_id));
      };
  }
  </code></pre>
  
  <p>Why do I get right value of object in</p>
  
  <pre><code>console.log(x.$getRecord(_id))
  </code></pre>
  
  <p>in console </p>
  
  <pre><code>Object {description: .......
  </code></pre>
  
  <p>but in controller</p>
  
  <pre><code>console.log(workoutFct.getUserWorkout(_id));
  </code></pre>
  
  <p>I get </p>
  
  <pre><code>undefined
  </code></pre>