mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-21 05:15:17 +02:00
Removed isolated scope. Now we can use a parent scope inside the tabs.
This commit is contained in:
@@ -2,24 +2,17 @@ module.exports = function niceTabsDirective() {
|
|||||||
return {
|
return {
|
||||||
restrict: 'EA',
|
restrict: 'EA',
|
||||||
replace: true,
|
replace: true,
|
||||||
scope: {
|
|
||||||
tabs: '=',
|
|
||||||
filter: '='
|
|
||||||
},
|
|
||||||
template: require('./nice-tabs.jade'),
|
template: require('./nice-tabs.jade'),
|
||||||
link: function (scope, element, attrs) {
|
link: function (scope, element, attrs) {
|
||||||
// TODO: add support for 'key' for saving in localstorage
|
// TODO: add support for 'key' for saving in localstorage
|
||||||
// TODO: add support for 'direction=below' for below tabs
|
// TODO: add support for 'direction=below' for below tabs
|
||||||
scope.$watch('tabs', function (newValue, oldValue) {
|
|
||||||
if (newValue !== oldValue) {
|
scope.$watch(attrs.tabs, function (newValue, oldValue) {
|
||||||
scope.tabs = newValue
|
scope.tabs = newValue
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
scope.$watch('filter', function (newValue, oldValue) {
|
scope.$watch(attrs.filter, function (newValue, oldValue) {
|
||||||
if (newValue !== oldValue) {
|
scope.filter = newValue
|
||||||
scope.filter = newValue
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
scope.tabFound = function (tab) {
|
scope.tabFound = function (tab) {
|
||||||
|
|||||||
Reference in New Issue
Block a user