diff --git a/src/features/tree-base/js/tree-base.js b/src/features/tree-base/js/tree-base.js index e6ce192a72..5654644b2d 100644 --- a/src/features/tree-base/js/tree-base.js +++ b/src/features/tree-base/js/tree-base.js @@ -1013,7 +1013,7 @@ if ( grid.options.treeRowHeaderAlwaysVisible === false && grid.treeBase.numberLevels <= 0 ){ newVisibility = false; } - if ( rowHeader.visible !== newVisibility ) { + if ( rowHeader && rowHeader.visible !== newVisibility ) { rowHeader.visible = newVisibility; rowHeader.colDef.visible = newVisibility; grid.queueGridRefresh(); diff --git a/src/js/core/directives/ui-grid-cell.js b/src/js/core/directives/ui-grid-cell.js index 9b9af47f48..50c69a0a6e 100644 --- a/src/js/core/directives/ui-grid-cell.js +++ b/src/js/core/directives/ui-grid-cell.js @@ -28,7 +28,7 @@ angular.module('ui.grid').directive('uiGridCell', ['$compile', '$parse', 'gridUt compiledElementFn($scope, function(clonedElement, scope) { $elm.append(clonedElement); }); - }); + }).catch(angular.noop); } else { var html = $scope.col.cellTemplate diff --git a/src/js/core/directives/ui-grid-column-menu.js b/src/js/core/directives/ui-grid-column-menu.js index c30e8d18fc..4206bbd92b 100644 --- a/src/js/core/directives/ui-grid-column-menu.js +++ b/src/js/core/directives/ui-grid-column-menu.js @@ -426,7 +426,7 @@ function ($timeout, gridUtil, uiGridConstants, uiGridColumnMenuService, $documen .then(function () { $scope.grid.refresh(); $scope.hideMenu(); - }); + }).catch(angular.noop); }; $scope.unsortColumn = function () { @@ -480,7 +480,7 @@ function ($timeout, gridUtil, uiGridConstants, uiGridColumnMenuService, $documen //The fallback action is to focus on the grid menu return focusToGridMenu(); } - }); + }).catch(angular.noop); } else { // Fallback action to focus on the grid menu focusToGridMenu(); diff --git a/src/js/core/directives/ui-grid-footer.js b/src/js/core/directives/ui-grid-footer.js index c3a42dad2a..bc5a1b8ce5 100644 --- a/src/js/core/directives/ui-grid-footer.js +++ b/src/js/core/directives/ui-grid-footer.js @@ -36,7 +36,7 @@ containerCtrl.footerViewport = footerViewport; } } - }); + }).catch(angular.noop); }, post: function ($scope, $elm, $attrs, controllers) { @@ -62,4 +62,4 @@ }; }]); -})(); \ No newline at end of file +})(); diff --git a/src/js/core/directives/ui-grid-grid-footer.js b/src/js/core/directives/ui-grid-grid-footer.js index 85dd89b875..d0424cfa49 100644 --- a/src/js/core/directives/ui-grid-grid-footer.js +++ b/src/js/core/directives/ui-grid-grid-footer.js @@ -24,7 +24,7 @@ var newElm = $compile(template)($scope); $elm.append(newElm); - }); + }).catch(angular.noop); }, post: function ($scope, $elm, $attrs, controllers) { @@ -35,4 +35,4 @@ }; }]); -})(); \ No newline at end of file +})(); diff --git a/src/js/core/directives/ui-grid-group-panel.js b/src/js/core/directives/ui-grid-group-panel.js index a96a58b07c..5d01af48ef 100644 --- a/src/js/core/directives/ui-grid-group-panel.js +++ b/src/js/core/directives/ui-grid-group-panel.js @@ -20,7 +20,7 @@ var newElm = $compile(template)($scope); $elm.append(newElm); - }); + }).catch(angular.noop); }, post: function ($scope, $elm, $attrs, uiGridCtrl) { @@ -33,4 +33,4 @@ }; }]); -})(); \ No newline at end of file +})(); diff --git a/src/js/core/directives/ui-grid-header-cell.js b/src/js/core/directives/ui-grid-header-cell.js index 5b97349bfb..45b9694790 100644 --- a/src/js/core/directives/ui-grid-header-cell.js +++ b/src/js/core/directives/ui-grid-header-cell.js @@ -119,7 +119,7 @@ if ( $scope.colMenu ) { uiGridCtrl.columnMenuScope.showMenu($scope.col, $elm, event); } - }); + }).catch(angular.noop); uiGridCtrl.fireEvent(uiGridConstants.events.COLUMN_HEADER_CLICK, {event: event, columnName: $scope.col.colDef.name}); @@ -350,7 +350,7 @@ .then(function () { if (uiGridCtrl.columnMenuScope) { uiGridCtrl.columnMenuScope.hideMenu(); } uiGridCtrl.grid.refresh(); - }); + }).catch(angular.noop); }; diff --git a/src/js/core/directives/ui-grid-header.js b/src/js/core/directives/ui-grid-header.js index b72fad95e4..cab6a0d188 100644 --- a/src/js/core/directives/ui-grid-header.js +++ b/src/js/core/directives/ui-grid-header.js @@ -59,7 +59,7 @@ } $scope.grid.queueRefresh(); - }); + }).catch(angular.noop); function updateHeaderReferences() { containerCtrl.header = containerCtrl.colContainer.header = $elm; diff --git a/src/js/core/directives/ui-grid-menu-button.js b/src/js/core/directives/ui-grid-menu-button.js index 4476e95003..b8742fb89a 100644 --- a/src/js/core/directives/ui-grid-menu-button.js +++ b/src/js/core/directives/ui-grid-menu-button.js @@ -323,7 +323,7 @@ angular.module('ui.grid') menuItem.title = successValue; }, function( errorValue ) { menuItem.title = errorValue; - }); + }).catch(angular.noop); } else { gridUtil.logError('Expected gridMenuTitleFilter to return a string or a promise, it has returned neither, bad config'); menuItem.title = 'badconfig'; diff --git a/src/js/core/directives/ui-grid-menu.js b/src/js/core/directives/ui-grid-menu.js index 8b1525e6ad..d6e9dd24bf 100644 --- a/src/js/core/directives/ui-grid-menu.js +++ b/src/js/core/directives/ui-grid-menu.js @@ -50,7 +50,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18 var template = angular.element(contents); var newElm = $compile(template)($scope); $elm.replaceWith(newElm); - }); + }).catch(angular.noop); } var setupHeightStyle = function(gridHeight) { @@ -248,7 +248,7 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18 var newElm = $compile(template)($scope); $elm.replaceWith(newElm); - }); + }).catch(angular.noop); } }, post: function ($scope, $elm, $attrs, controllers) { diff --git a/src/js/core/directives/ui-grid-row.js b/src/js/core/directives/ui-grid-row.js index 3268375ae8..9c055caf1d 100644 --- a/src/js/core/directives/ui-grid-row.js +++ b/src/js/core/directives/ui-grid-row.js @@ -46,7 +46,7 @@ clonedElement = newElm; cloneScope = newScope; }); - }); + }).catch(angular.noop); } // Initially attach the compiled template to this scope @@ -67,4 +67,4 @@ }; }]); -})(); \ No newline at end of file +})(); diff --git a/src/js/core/directives/ui-grid.js b/src/js/core/directives/ui-grid.js index d5dbfd0ecd..89adb15788 100644 --- a/src/js/core/directives/ui-grid.js +++ b/src/js/core/directives/ui-grid.js @@ -31,7 +31,7 @@ self.grid.preCompileCellTemplates(); self.grid.refreshCanvas(true); - }); + }).catch(angular.noop); }); } @@ -74,7 +74,7 @@ self.grid.preCompileCellTemplates(); self.grid.callDataChangeCallbacks(uiGridConstants.dataChange.COLUMN); - }); + }).catch(angular.noop); } } @@ -118,7 +118,7 @@ promises.push(self.grid.buildColumns() .then(function() { self.grid.preCompileCellTemplates(); - })); + }).catch(angular.noop)); } $q.all(promises).then(function() { @@ -133,8 +133,8 @@ self.grid.refreshCanvas(true); self.grid.callDataChangeCallbacks(uiGridConstants.dataChange.ROW); }); - }); - }); + }).catch(angular.noop); + }).catch(angular.noop); } } diff --git a/src/js/core/factories/Grid.js b/src/js/core/factories/Grid.js index 01f5bdaa90..ae532d768b 100644 --- a/src/js/core/factories/Grid.js +++ b/src/js/core/factories/Grid.js @@ -795,8 +795,8 @@ angular.module('ui.grid') .then( function() { self.preCompileCellTemplates(); self.queueGridRefresh(); - }); - }); + }).catch(angular.noop); + }).catch(angular.noop); }; /** @@ -913,7 +913,7 @@ angular.module('ui.grid') if (self.rows.length > 0){ self.assignTypes(); } - }); + }).catch(angular.noop); }; Grid.prototype.preCompileCellTemplate = function(col) { @@ -943,7 +943,7 @@ angular.module('ui.grid') } else if ( col.cellTemplatePromise ){ col.cellTemplatePromise.then( function() { self.preCompileCellTemplate( col ); - }); + }).catch(angular.noop); } }); }; @@ -1161,12 +1161,12 @@ angular.module('ui.grid') var p1 = $q.when(self.processRowsProcessors(self.rows)) .then(function (renderableRows) { return self.setVisibleRows(renderableRows); - }); + }).catch(angular.noop); var p2 = $q.when(self.processColumnsProcessors(self.columns)) .then(function (renderableColumns) { return self.setVisibleColumns(renderableColumns); - }); + }).catch(angular.noop); return $q.all([p1, p2]); }; @@ -1362,7 +1362,7 @@ angular.module('ui.grid') else { finished.resolve(processedRows); } - }); + }).catch(angular.noop); } // Start on the first processor @@ -1490,7 +1490,7 @@ angular.module('ui.grid') else { finished.resolve(myRenderableColumns); } - }); + }).catch(angular.noop); } // Start on the first processor @@ -1563,7 +1563,7 @@ angular.module('ui.grid') self.refreshCanceller.then(function () { self.refreshCanceller = null; - }); + }).catch(angular.noop); return self.refreshCanceller; }; @@ -1588,7 +1588,7 @@ angular.module('ui.grid') self.gridRefreshCanceller.then(function () { self.gridRefreshCanceller = null; - }); + }).catch(angular.noop); return self.gridRefreshCanceller; }; @@ -2068,17 +2068,17 @@ angular.module('ui.grid') var p1 = self.processRowsProcessors(self.rows).then(function (renderableRows) { self.setVisibleRows(renderableRows); - }); + }).catch(angular.noop); var p2 = self.processColumnsProcessors(self.columns).then(function (renderableColumns) { self.setVisibleColumns(renderableColumns); - }); + }).catch(angular.noop); return $q.all([p1, p2]).then(function () { self.redrawInPlace(rowsAltered); self.refreshCanvas(true); - }); + }).catch(angular.noop); }; /** @@ -2099,7 +2099,7 @@ angular.module('ui.grid') self.redrawInPlace(); self.refreshCanvas( true ); - }); + }).catch(angular.noop); }; /** diff --git a/src/js/core/services/gridClassFactory.js b/src/js/core/services/gridClassFactory.js index 62fe6fb455..4d8b12e21f 100644 --- a/src/js/core/services/gridClassFactory.js +++ b/src/js/core/services/gridClassFactory.js @@ -38,7 +38,7 @@ function (res) { // Todo handle response error here? throw new Error("Couldn't fetch/use row template '" + grid.options.rowTemplate + "'"); - }); + }).catch(angular.noop); } grid.registerColumnBuilder(service.defaultColumnBuilder); @@ -119,7 +119,7 @@ }, function (res) { throw new Error("Couldn't fetch/use colDef." + templateType + " '" + colDef[templateType] + "'"); - }) + }).catch(angular.noop) ); }; diff --git a/src/js/core/services/ui-grid-util.js b/src/js/core/services/ui-grid-util.js index 90b1a1bc85..a379c2e546 100644 --- a/src/js/core/services/ui-grid-util.js +++ b/src/js/core/services/ui-grid-util.js @@ -352,13 +352,13 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC // See if the template is itself a promise if (angular.isFunction(template.then)) { - return template.then(s.postProcessTemplate); + return template.then(s.postProcessTemplate).catch(angular.noop); } // If the template is an element, return the element try { if (angular.element(template).length > 0) { - return $q.when(template).then(s.postProcessTemplate); + return $q.when(template).then(s.postProcessTemplate).catch(angular.noop); } } catch (err){ @@ -380,7 +380,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC throw new Error("Could not get template " + template + ": " + err); } ) - .then(s.postProcessTemplate); + .then(s.postProcessTemplate).catch(angular.noop); }, //