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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -