Type error in angularjs login is not a function

var myModule = angular.module(“myModule”,[]);

myModule.controller(‘addLoginController’,function($scope,$http,$log){

$scope.login() = function() { 
  $scope.user =  $http({
        method: 'POST',
        url: 'http://127.0.0.1:8000/users',
        data: {
            email: $scope.email,
            password:$scope.password
        },
        headers: {"Content-Type": 'application/json'}
    })
    .then(function(response){
        $scope.userData = response.data;
        $scope.status = response.status;
        $scope.headers = response.headers;
        $scope.config = response.config;

        $log.console(response);
    }, function (response) {
        $scope.error = response.data;
        alert("unsuccessful call");
    });

} });

Answer

This is the correct syntax for a function expression (remove ()):

$scope.login = function() { 
...
}