I am currently using a custom filter to aggregate a $scope object within an ng-repeat block. Here is my code snippet:
$scope.myobj = isSelected ? $filter('customFilter')($scope.origObj) : $scope.origObj
In the above code, $scope.myobj
is utilized in the ng-repeat. If the isSelected
flag is true, the original object is filtered and returned into $scope.myobj
; otherwise, the original object is returned as is. However, I have noticed that any changes made to objects within the filtered array do not reflect in the original array, which makes sense since they are different objects.
Is there a way to ensure that these changes are reflected in the original array when the filter is not active? Currently, my workaround involves refreshing the view after an update (server request), but I am searching for a more efficient method that would only update the specific row being edited without requiring a full refresh.