title: TypeError: AuthenticateService.checkUser is not a function
body: <p><strong>TypeError: AuthenticateService.checkUser is not a function</strong></p>
  
  <pre><code>I am submitting a login page with credentials, for sending the credentials to the server I have service **AuthenticateService** with $http.post, calling the method in the above mentioned service from the contactLoginCtrl.js (controller),
  during that I am encountering this error
  </code></pre>
  
  <p>below is the code for <strong>AuthenticateService</strong></p>
  
  <pre><code>  angular.module('app.services')
  .service('AuthenticateService',['$http',function($http){
  
      return{         
  
          checkUser : function(uname, pword){
  
               var indata = { "password": pword, "username":uname };
               var req ={
                            method: 'POST',
                            url: 'http://localhost:8083/spring2/login',
                            data: indata
                        }
  
                    $http(req).then(function (response) {
                        console.log(response);
                        return response;
                    }, function (error) {
                        console.log(error);
                        return error;
  
                    });
                  }
  
              }
  
  }]); 
  </code></pre>
  
  <p>below is the controller code contactLoginCtlrls.js</p>
  
  <pre><code>angular.module('app.controllers')
  .controller('contactLoginCtrl',['$rootScope','$scope','AuthenticateService','$location',function($scope,AuthenticateService,$location){
  
      $scope.authenticate =  function(userModel){
          var userName = userModel.username;
          var password = userModel.password;
          console.log(userName+password);
  
           ***AuthenticateService.checkUser(userName,password);***
      };
  
  }])
   The above highlighted line is causing the error could some one please check this?
  
  
  ----------------------ignore the below section------------------------
  </code></pre>
  
  <p>content added only for skipping the error from stackoverflow  to add some more detail   </p>