Scope confusion in ng-grid when returning data from modal

前端 未结 2 1615
暖寄归人
暖寄归人 2021-01-23 00:55

Here is the Plunker: http://plnkr.co/edit/aqLnno?p=preview

I have a list of persons ($scope.persons) to be displayed in a ng-grid. Each line has a edit butt

2条回答
  •  借酒劲吻你
    2021-01-23 01:22

    Looks like ng-grid isn't updating correctly when you are changing the array

    You might keep the pointer of the row entity like in this example here: http://plnkr.co/edit/0lDoKOg4kXXa51NlSuMg?p=preview

    It uses $scope.persons[index].data = person.data; instead of $scope.persons[index] = person;.

提交回复
热议问题