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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -