Skip to content

Commit

Permalink
fix: initialize $scope.$tabSelected when nested tabs selected.
Browse files Browse the repository at this point in the history
Like the issue #1276 if you have some nested tabs, you select a sub-tab
item, and you will active some other siblings, because when tabCtrl add
every new $scope, it does't has a initial attr $scope.$tabSelected, so
every unselected item will read the $tabSelected from inherited $parent,
but if the parent-tab has been actived, the all of its sub-tabs
will read this true property in $scope.$tabSelected. So I think we
should initialize the property $scope.$tabSelected before invoking
tabsCtrl.add(), and every tab-item will has a 'false' status for a
initial $scope.$tabSelected.
  • Loading branch information
abruzzihraig committed Mar 3, 2015
1 parent 873cded commit ec7bf20
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions js/angular/directive/tab.js
Expand Up @@ -100,6 +100,7 @@ function($compile, $ionicConfig, $ionicBind, $ionicViewSwitcher) {
var tabsCtrl = ctrls[0];
var tabCtrl = ctrls[1];
var isTabContentAttached = false;
$scope.$tabSelected = false;

$ionicBind($scope, $attr, {
onSelect: '&',
Expand Down

0 comments on commit ec7bf20

Please sign in to comment.