Skip to content

Commit 3a39033

Browse files
committed
Merge pull request #5044 from debrice/fast-watch-length-watcher
fix(#5041): Ensure length watchers transmit data
2 parents 60fe84b + f57682c commit 3a39033

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/core/directives/ui-grid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
}, dataWatchFunction) );
5252
} else {
5353
deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.data; }, dataWatchFunction) );
54-
deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.data.length; }, dataWatchFunction) );
54+
deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.data.length; }, function(){ dataWatchFunction($scope.uiGrid.data); }) );
5555
}
5656
deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.columnDefs; }, columnDefsWatchFunction) );
57-
deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.columnDefs.length; }, columnDefsWatchFunction) );
57+
deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.columnDefs.length; }, function(){ columnDefsWatchFunction($scope.uiGrid.columnDefs); }) );
5858
} else {
5959
if (angular.isString($scope.uiGrid.data)) {
6060
deregFunctions.push( $scope.$parent.$watchCollection($scope.uiGrid.data, dataWatchFunction) );

0 commit comments

Comments
 (0)