Angular function with two parameters having Error: [$parse:syntax]
问题 The full error is: Error: [$parse:syntax] Syntax Error: Token ',' not a primary expression The piece of code causing the error is: <div ng-repeat="item in items"> <input type="submit" ng-click="delete({{item.itemId}},$index)" value="delete"> </div> The function actually works for previous items but breaks when I try a new item to my item array. The problem child appears to be the comma, but I do not know what to do. 回答1: You don't need to wrap item.itemId in {{}} . Just do: ng-click="delete