title: Angular, "x is not a function" when attempting to use Service
body: <pre><code>app.service('situacao', function($log, $q, $http, $rootScope){
      var situacao = this; 
      situacao.lista = {};
      situacao.getAllSituacao = function(){
          var defer = $q.defer();
          console.log(&quot;php/getAll.php&quot;);
          $http.get($rootScope.endPoint + &quot;php/getAll.php&quot;)
              .success(function(res) {
              console.log(res);
              situacao.lista = res;
              defer.resolve(res);
          }).error(function(err, status){
              defer.reject(err);
          }); 
          return defer.promise;
      };
      return situacao;});
      app.controller('listCtrl',['$scope', '$uibModal', '$log', '$http', function(situacao, $scope, $modal, $log, $http) {   
      $scope.init = function(){
          $scope.getAll();
      }
      $scope.getAll = function(){        
          situacao.getAllSituacao().then(function(res){
              //sucess
              $scope.dispSituacao = situacao.lista;  
          }, function(err){
              //error
          })
      };
      $scope.init(); 
  }]);
  </code></pre>
  <p>I'm trying to use the &quot;service&quot; but results in error:
  situacao.getAllSituacao is not a function.</p>
  <p>what is wrong?</p>