title: Console error, not sure way
body: <p>I am getting this error.. not sure what's the problem..</p>
  
  <p>TypeError: StatisticsService.getStatisticsFromServer is not a function</p>
  
  <p>i cant seem to see the problem, not sure what i'm doing wrong</p>
  
  <p>this is the controller</p>
  
  <pre><code>app.controller('StatisticsCtrl',
          ['$scope',
            '$auth',
            'StatisticsService',
             function ($scope, $auth, StatisticsService) {
  
                 var token = $auth.getToken();
  
                 console.log('StatisticsCtrl INIT');
  
                  function run() {
                      var data = {
  
                          token: token,
                          timestamp_from: moment(new Date()).unix()-30 * 24 * 3600,
                          timestamp_till: moment(new Date()).unix(),
                          order: 'duration_minutes',
                          limit: 20
                      };
  
  //                     
  
  
                      StatisticsService.getStatisticsFromServer(data).then(function (response) {
  
                          console.log('syncStatistics', (response));
  
                                  $scope.statistics = response;
                                  // $scope.statistics = StatisticsService.buildStatsUsers(response.data);  //  jason comes from here
  
  
  
                          }, function (error) {
                          console.error(error);
                          });
                  }
  
  
              run();
  
          }]);
  </code></pre>
  
  <p>this is the server </p>
  
  <pre><code>app.service('StatisticsService',
          ['apiClient', '$q', '$rootScope', '$timeout',
              function (apiClient, $q, $rootScope, $timeout) {
  
                  var self = this;
  
                  self.getUserProfiles = function (stats) {
  
                      var emails = [];
  
                      for (var i = 0; i &lt; stats.length; i++) {
                          emails.push(stats[i].email);
                      }
  
                      console.log(emails);
  
                      var data2 = {
                          token: data.token,
                          profile_emails: emails
                      };
  
                      apiClient.getUserProfiles(data2).then(function (response2) {
  
                          console.log('getUserProfiles', (response2));
  
                          if (response2.data.length === 0 || response2.result !== "success") {
                              // TODO: show error
                              deferred.reject(response2);
                          }
  
                          var stats2= response2.data;
  
                          deferred.resolve(stats);//3
  
                      }
                      );
  
  
                      self.getStatisticsFromServer = function (data) {
  
                          var deferred = $q.defer(); //1
  
  
                          apiClient.getStatsTopMeeters(data)
  
                                  .then(function (response) { //2
  
                                      console.log('externalApiConnect', response);
  
  
                                      if (response.data.length === 0 || response.result !== "success") {
                                          // TODO: show error
                                          deferred.reject(response);
                                      }
  
                                      var stats = response.data;
  
                                      stats = self.getUserProfiles(stats);
  
                                      deferred.resolve(stats);//3
                                  }
                                  , function (error) {
                                      deferred.reject(error);
                                      console.error(error);
                                  });
  
                          return deferred.promise; //4
  
                      };
                  };
              }]);
  </code></pre>