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: firbug

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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -