I have following code that is suppose to add another row at current row location (not at the bottom of the rows):
<tr ng-repeat="ro in rows">
<td>{{ro.name}}</td>
<td>{{ro.id}}</td>
<td><a ng-click="addRo($index)">add row</a></td>
</tr>
In my controller, I have:
$scope.addRo=function(index){
$scope.inderted={
id: '',
name: ''
};
$scope.rows($index+1).push($scope.inserted);
}
I tried the above code hopeing adding index to the current location it would add it, but it doesn't work. How to fix this?