I am facing a problem with below code. It showing $http undefined in console. I have injected $scope and $http as well
SignInCtrl.$inject = ['$scope', '$http'];
function SignInCtrl($scope,$http) {
$scope.login = function($http) {
return $http.post('/user/login', user).then(handleSuccess, handleError('Error creating user'));
};
}