Skip to content

Commit d3af956

Browse files
committed
chore(uiGrid): Dereg styleComp. $watch on $destroy
1 parent dd6dc15 commit d3af956

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,16 @@
134134
}
135135
}
136136

137+
var styleWatchDereg = $scope.$watch(function () { return self.grid.styleComputations; }, function() {
138+
self.grid.refreshCanvas(true);
139+
});
140+
137141
$scope.$on('$destroy', function() {
138142
dataWatchCollectionDereg();
139143
columnDefWatchCollectionDereg();
144+
styleWatchDereg();
140145
});
141146

142-
$scope.$watch(function () { return self.grid.styleComputations; }, function() {
143-
self.grid.refreshCanvas(true);
144-
});
145-
146-
147147
self.fireEvent = function(eventName, args) {
148148
// Add the grid to the event arguments if it's not there
149149
if (typeof(args) === 'undefined' || args === undefined) {

0 commit comments

Comments
 (0)