title: Angular JS - Passing Firebase data from Service to Controller
body: <p>I am trying to pass my Firebase data from a Service to Controller but getting an error: TypeError: <em>MeetingNamesService.myCalTimes is not a function</em>.</p>
  
  <p><strong>Service:</strong></p>
  
  <pre><code>angular.module('app.services', [])
  
  .factory('MeetingNamesService', [function($firebaseArray){
  
      var myCalTimes = new Firebase("https://xxxxxxxx.firebaseio.com");
  
      myCalTimes.on("value", function(snapshot) {
          var calTimes = snapshot.val();
          return $firebaseArray(calTimes);        
  
      }, function (errorObject) {
        console.log("Data failed: " + errorObject.code);
      });
  }])
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>.controller('monthsCtrl', function($scope, MeetingNamesService, $ionicLoading) {
  
      $scope.times = MeetingNamesService.myCalTimes();
      $scope.times = calTimes;    
      console.log($scope.times);
  })
  </code></pre>
  
  <p>Any idea why it's not recognising <em>myCalTimes</em> as a function? Thanks.</p>