Changed tabs not use isolated scope

This commit is contained in:
Max Lynch
2013-11-18 10:47:18 -06:00
parent fd0e24def9
commit f300b162f1
2 changed files with 16 additions and 12 deletions

View File

@ -24573,24 +24573,26 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
}; };
$scope.controllers = this.controllers; $scope.controllers = this.controllers;
$scope.tabsController = this;
}]) }])
.directive('tabs', function() { .directive('tabs', function() {
return { return {
restrict: 'E', restrict: 'E',
replace: true, replace: true,
scope: { scope: true,
animation: '@',
controllerChanged: '&',
tabsType: '@',
tabsStyle: '@',
},
transclude: true, transclude: true,
controller: 'TabsCtrl', controller: 'TabsCtrl',
//templateUrl: 'ext/angular/tmpl/ionicTabBar.tmpl.html', //templateUrl: 'ext/angular/tmpl/ionicTabBar.tmpl.html',
template: '<div class="content"><tab-controller-bar></tab-controller-bar></div>', template: '<div class="content"><tab-controller-bar></tab-controller-bar></div>',
compile: function(element, attr, transclude, tabsCtrl) { compile: function(element, attr, transclude, tabsCtrl) {
return function($scope, $element, $attr) { return function($scope, $element, $attr) {
$scope.tabsType = $attr.tabsType || 'tabs-positive';
$scope.tabsStyle = $attr.tabsStyle;
$scope.animation = $attr.animation;
$scope.$watch('activeAnimation', function(value) { $scope.$watch('activeAnimation', function(value) {
//$element.removeClass($scope.animation + ' ' + $scope.animation + '-reverse'); //$element.removeClass($scope.animation + ' ' + $scope.animation + '-reverse');
$element.addClass($scope.activeAnimation); $element.addClass($scope.activeAnimation);

View File

@ -39,24 +39,26 @@ angular.module('ionic.ui.tabs', ['ngAnimate'])
}; };
$scope.controllers = this.controllers; $scope.controllers = this.controllers;
$scope.tabsController = this;
}]) }])
.directive('tabs', function() { .directive('tabs', function() {
return { return {
restrict: 'E', restrict: 'E',
replace: true, replace: true,
scope: { scope: true,
animation: '@',
controllerChanged: '&',
tabsType: '@',
tabsStyle: '@',
},
transclude: true, transclude: true,
controller: 'TabsCtrl', controller: 'TabsCtrl',
//templateUrl: 'ext/angular/tmpl/ionicTabBar.tmpl.html', //templateUrl: 'ext/angular/tmpl/ionicTabBar.tmpl.html',
template: '<div class="content"><tab-controller-bar></tab-controller-bar></div>', template: '<div class="content"><tab-controller-bar></tab-controller-bar></div>',
compile: function(element, attr, transclude, tabsCtrl) { compile: function(element, attr, transclude, tabsCtrl) {
return function($scope, $element, $attr) { return function($scope, $element, $attr) {
$scope.tabsType = $attr.tabsType || 'tabs-positive';
$scope.tabsStyle = $attr.tabsStyle;
$scope.animation = $attr.animation;
$scope.$watch('activeAnimation', function(value) { $scope.$watch('activeAnimation', function(value) {
//$element.removeClass($scope.animation + ' ' + $scope.animation + '-reverse'); //$element.removeClass($scope.animation + ' ' + $scope.animation + '-reverse');
$element.addClass($scope.activeAnimation); $element.addClass($scope.activeAnimation);