Scope confusion in ng-grid when returning data from modal
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 button. When the user clicks on the button ( ng-click="edit(row)" ) (see code below), I copy the displayed person ( angular.copy(row.entity) ) and open a modal dialog. ... so far so good. When the user clicks "Cancel" on the modal, nothing happens. When the user clicks "Save" on the model, the modified person is returned and should be "reintegrated" in $scope.persons . This is where the problem starts: I search in $scope.persons to find the