From b4e30aae75cc663baf03ec40ebab990ad6f4f6f0 Mon Sep 17 00:00:00 2001 From: Gunther Brunner Date: Tue, 8 Apr 2014 19:41:29 +0900 Subject: [PATCH] Removed isolated scope. Now we can use a parent scope inside the tabs. --- .../common-ui/nice-tabs/nice-tabs-directive.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/res/app/components/stf/common-ui/nice-tabs/nice-tabs-directive.js b/res/app/components/stf/common-ui/nice-tabs/nice-tabs-directive.js index a30de75a..a53bed25 100644 --- a/res/app/components/stf/common-ui/nice-tabs/nice-tabs-directive.js +++ b/res/app/components/stf/common-ui/nice-tabs/nice-tabs-directive.js @@ -2,24 +2,17 @@ module.exports = function niceTabsDirective() { return { restrict: 'EA', replace: true, - scope: { - tabs: '=', - filter: '=' - }, template: require('./nice-tabs.jade'), link: function (scope, element, attrs) { // TODO: add support for 'key' for saving in localstorage // TODO: add support for 'direction=below' for below tabs - scope.$watch('tabs', function (newValue, oldValue) { - if (newValue !== oldValue) { - scope.tabs = newValue - } + + scope.$watch(attrs.tabs, function (newValue, oldValue) { + scope.tabs = newValue }) - scope.$watch('filter', function (newValue, oldValue) { - if (newValue !== oldValue) { - scope.filter = newValue - } + scope.$watch(attrs.filter, function (newValue, oldValue) { + scope.filter = newValue }) scope.tabFound = function (tab) {