Reputation: 583
In my controller I have this function:
$scope.add = function(key){
$scope.key = key;
};
And this is my html view:
<button type="button" ng-click="addVote({{key}});">Confirm</button>
My question is about the ng-click="addVote({{key}})
. I want to call the $scope.key
value in my view. It doesn't work. What the mistake I did?
Upvotes: 1
Views: 2006
Reputation: 1508
You don't need to perform any interpolation in attributes such as ng-click. So your code should be as follows:
<button type="button" ng-click="addVote(key);">Confirm</button>
Upvotes: 1