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.
- Select a row & press update button. Nothing happens.
- Press add button. Now UI gets updated with new element & as well as the previously updated element.
- Same behavior gets repeated again & again.
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!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…