angularjs - function call in ng-repeat does not render properly -
i have piece of code:
<tr ng-repeat="convention in conventions"> <td>{{ convention.id }}</td> <td>{{ convention.title }}</td> <td><a href="javascript:void(0)" ng-click="alert(convention.id)">edit</a></td> </tr>
i wanna call function alert
, pass id
parameter.but not render properly:
any suggestion?
wrap alert()
in function in controller , add scope this:
$scope.handleclick = function(id) { alert(id); }
then call function template:
ng-click="handleclick(contention.id)"
expressions embedded in templates see functions in respective scope.
Comments
Post a Comment