From e952ab4100826a5ff2e36efe71d5d6b8d49df2b2 Mon Sep 17 00:00:00 2001 From: Eugene OZ Date: Tue, 30 Dec 2014 22:57:56 +0300 Subject: [PATCH] fix(tabs): pagination only call watcher() when it's a function Fix for #1072. Closes #1073. --- src/components/tabs/js/paginationDirective.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/tabs/js/paginationDirective.js b/src/components/tabs/js/paginationDirective.js index 68e341a78b3..d51353d975f 100644 --- a/src/components/tabs/js/paginationDirective.js +++ b/src/components/tabs/js/paginationDirective.js @@ -102,7 +102,9 @@ function TabPaginationDirective($mdConstant, $window, $$rAF, $$q, $timeout, $mdM function () { $timeout(function () { if (element[0].offsetParent) { - watcher(); + if (angular.isFunction(watcher)) { + watcher(); + } debouncedUpdatePagination(); watcher = null; }