Skip to content

Commit ec7bf20

Browse files
committed
fix: initialize $scope.$tabSelected when nested tabs selected.
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.
1 parent 873cded commit ec7bf20

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: js/angular/directive/tab.js

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function($compile, $ionicConfig, $ionicBind, $ionicViewSwitcher) {
100100
var tabsCtrl = ctrls[0];
101101
var tabCtrl = ctrls[1];
102102
var isTabContentAttached = false;
103+
$scope.$tabSelected = false;
103104

104105
$ionicBind($scope, $attr, {
105106
onSelect: '&',

0 commit comments

Comments
 (0)