I am trying to update ng-grid with array splice
.
I have a plunk here.
Add button adds new row. Update button updates last item in the array.
I tried $scope.$apply
. I get:
“Error: $apply already in progress”
I even tried by placing $scope.$apply
block inside a setTimeout
call. Again the same error!
Any pointers!
Thanks!
That's because data $watcher in ng-grid (incorrectly) compares the data object for reference, instead on object equality. You might remedy this by setting the third parameter to true in data $watch function (line 3128):
$scope.$parent.$watch(options.data, dataWatcher, true);