So I have an Angular project with the following in my directive template
<div ng-repeat="poll in polls">
<div ng-repeat="choice in poll.choices">
<input type="radio" name="choice" ng-model="userVote" ng-value="choice.text">
{{choice.text}}
<button ng-click="vote(userVote)">Vote!</button>
</div>
</div>
And my controller has the following...
$scope.vote = function(userVote){
alert(userVote);
}
But the alert says undefined, despite the {{choice.text}} showing up properly. There are no JS errors and the other functions in the controller work as expected.