Angular using $index in ng-model Angular using $index in ng-model angularjs angularjs

Angular using $index in ng-model


It becomes an invalid expression with the usage of interpolation with ng-model expression. You need to provide a property name there. Instead you can use an object and use bracket notation.

i.e in your controller:

$scope.interpretation = {};

and in your view use it as:

ng-model="interpretation[$index + 1]"

Demo