Skip to content Skip to sidebar Skip to footer

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:

Solution 1:

You don't need to wrap item.itemId in {{}}. Just do:

ng-click="delete(item.itemId, $index)"

You only need to wrap in braces when using Angular's templating system - the braces tell Angular to replace the value. In this case, the value of ng-click is an expression that is evaluated (within the scope of your controller) when a click event occurs.

Demo Fiddle

Post a Comment for "Angular Function With Two Parameters Having Error: [$parse:syntax]"