AngularJs ng-click event only triggered with literal arguments

后端 未结 2 803
星月不相逢
星月不相逢 2021-02-14 13:20

When I call within a ng-repeat group

Delete

the remove function is

相关标签:
2条回答
  • 2021-02-14 13:42

    You shouldn't use curly braces in the ng-click expressions. Try this instead:

    <span ng-click="remove(user.id)">Delete</span>
    

    And be sure to check the AngularJS expressions documentation: http://docs.angularjs.org/guide/expression

    0 讨论(0)
  • 2021-02-14 13:55

    ng-click="remove(user.id)" should work, ng-click evaluate it content so you don't need interpolation

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