From 2b6dd4dced54e62721a1339143cf7b8996ba9e88 Mon Sep 17 00:00:00 2001 From: Thomas Burleson Date: Thu, 30 Apr 2015 12:18:27 -0500 Subject: [PATCH] fix(gridlist): noops layoutDelegate Fixes #2613. --- src/components/gridList/gridList.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/gridList/gridList.js b/src/components/gridList/gridList.js index cd3c59c2585..7ed32d764c4 100644 --- a/src/components/gridList/gridList.js +++ b/src/components/gridList/gridList.js @@ -112,7 +112,7 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) { var invalidateLayout = angular.bind(ctrl, ctrl.invalidateLayout), unwatchAttrs = watchMedia(); - scope.$on('$destroy', unwatchMedia); + scope.$on('$destroy', unwatchMedia); /** * Watches for changes in media, invalidating layout as necessary. @@ -128,6 +128,8 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) { } function unwatchMedia() { + ctrl.layoutDelegate = angular.noop; + unwatchAttrs(); for (var mediaName in $mdConstant.MEDIA) { $mdMedia.getQuery($mdConstant.MEDIA[mediaName])