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) {