Skip to content

Commit

Permalink
update tab broadcasts, fixes #415
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bradley committed Jan 14, 2014
1 parent 9efe95e commit cf6598b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dist/js/ionic-angular.js
Expand Up @@ -2302,7 +2302,7 @@ angular.module('ionic.ui.tabs', ['ionic.service.view'])
if(childElement) {
childElement.remove();
childElement = null;
$scope.$broadcast('tab.hidden');
$rootScope.$broadcast('tab.hidden');
}
if(childScope) {
childScope.$destroy();
Expand All @@ -2315,8 +2315,8 @@ angular.module('ionic.ui.tabs', ['ionic.service.view'])
clone.removeAttr('title');
childElement = clone;
$element.parent().append(childElement);
$scope.$broadcast('tab.shown');
});
$rootScope.$broadcast('tab.shown');
}
});

Expand Down

2 comments on commit cf6598b

@nafisto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason this was changed from $scope to $rootScope? This changes the event behavior so all tab controllers receive the broadcast whenever ANY tab is shown.

@jough
Copy link

@jough jough commented on cf6598b Feb 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this introduces a new bug where any tab that gets shown now fires the event to ALL tab controllers.

Please sign in to comment.