Passing multiple argument to ng-click method

前端 未结 1 1869
温柔的废话
温柔的废话 2021-01-03 19:45

In my code i like to pass to arguments to the function specified inside the ng-click attribute.

<
1条回答
  •  Happy的楠姐
    2021-01-03 20:08

    You don't need {{ }} while specifying arguments to an event handlers (ng-click). The correct syntax would be ng-click="deleteUser($index, user._id):

    {{user.name}}

    Here is a working plunker based on the code you've provided (check the console to see that click handler is working correctly): http://plnkr.co/edit/26A4Rj0FScPXYU7z92E6?p=preview

    0 讨论(0)
提交回复
热议问题