2017-10-16 117 views
1

我试图在我的电子商务Web应用程序中实现支付系统,我需要由客户端选择安装选项。我使用angularjs来获取这些信息,但是我得到以下所有提供的函数都不是函数的错误。我可以提供更多的信息,但这里是与此问题相关的部分:AngularJS不是函数错误

$scope.tekcekim() = function() { 
     $scope.strInstallmentCount = ""; 
    }; 

    $scope.taksit2() = function() { 
     $scope.strInstallmentCount = "2"; 
    }; 

    $scope.taksit3() = function() { 
     $scope.strInstallmentCount = "3"; 
    }; 
+4

$ scope.tekcekim所示前到$ scope.tekcekim $ scope.taksit2(至$ scope.taksit2 –

+1

$ scope.taksit3()到$ scope.taksit3 –

回答

1

应该是没有()

$scope.tekcekim = function() { 
     $scope.strInstallmentCount = ""; 
}; 

$scope.taksit2 = function() { 
    $scope.strInstallmentCount = "2"; 
}; 

$scope.taksit3 = function() { 
    $scope.strInstallmentCount = "3"; 
}; 
+0

我将需要清洁我的眼镜,以查看差异 –

+0

谢谢你的工作! –

+1

@NebihBaşaran只是删除变量名旁边的大括号 – Sajeetharan

2

删除()在$范围。

$scope.tekcekim = function() { 
     $scope.strInstallmentCount = ""; 
    }; 

    $scope.taksit2 = function() { 
     $scope.strInstallmentCount = "2"; 
    }; 

    $scope.taksit3 = function() { 
     $scope.strInstallmentCount = "3"; 
    }; 
0

remove()paranthesis。写与$范围的任何功能等())下面

$scope.foo=function(){ 
     //some code goes here 
    };