From 2976add783e679ac73838acead31f4075ce16e5d Mon Sep 17 00:00:00 2001 From: Robert Messerle Date: Fri, 31 Jul 2015 09:58:15 -0700 Subject: [PATCH] fix(tabs): removes scope disconnect logic from tab templates This is necessary due to various bugs with disconnecting scope. The API remains the same for now, but in 0.11 we will revise the API's to more accurately describe what is going on under the hood. Closes #3692 --- src/components/tabs/js/templateDirective.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/components/tabs/js/templateDirective.js b/src/components/tabs/js/templateDirective.js index 4e39ba88152..b30d927d028 100644 --- a/src/components/tabs/js/templateDirective.js +++ b/src/components/tabs/js/templateDirective.js @@ -2,14 +2,13 @@ angular .module('material.components.tabs') .directive('mdTemplate', MdTemplate); -function MdTemplate ($compile, $mdUtil) { +function MdTemplate ($compile) { return { restrict: 'A', link: link, scope: { template: '=mdTemplate', - compileScope: '=mdScope', - connected: '=?mdConnectedIf' + compileScope: '=mdScope' }, require: '^?mdTabs' }; @@ -22,20 +21,5 @@ function MdTemplate ($compile, $mdUtil) { ctrl.updatePagination(); ctrl.updateInkBarStyles(); }); - return $mdUtil.nextTick(handleScope); - function handleScope () { - scope.$watch('connected', function (value) { value === false ? disconnect() : reconnect(); }); - scope.$on('$destroy', reconnect); - } - - function disconnect () { - if (ctrl.scope.noDisconnect) return; - $mdUtil.disconnectScope(compileScope); - } - - function reconnect () { - if (ctrl.scope.noDisconnect) return; - $mdUtil.reconnectScope(compileScope); - } } }