title: AngularJS TypeError is not a function
body: <p>I have the following code in my service:</p>
  
  <pre><code>testApp.service('detailsService',['databaseService', 'loggedService', '$http', function(databaseService, loggedService, $http){
  
      var details;
  
      this.getDetails = function(name){
  
          return $http({
              method : "GET",
              url : name    
          }).then(function(response) {
             details= response.data;
             console.log(response.data);
             return response.data;
          });
  
      };
  
  }]);
  </code></pre>
  
  <p>What i want to do is call this function in my controller when the page(view) is loaded. </p>
  
  <pre><code>testApp.controller('testController', ['$scope', '$location', 'databaseService','detailsService', '$routeParams', function($scope, $location, databaseService, $routeParams, detailsService){
  
      $scope.details;
  
      var selectedDetails = function(name){
               detailsService.getDetails(name).then(function(data){
              $scope.details= data;
          });
      };
  
      selectedDetails(name);
  
  }]);
  </code></pre>
  
  <p>I keep getting the error detailsService.getDetails is not a function.
  I'm using the same function from the detailsService in another controller without any problems.</p>
  
  <p>Does anybody know why i keep getting this error?</p>