refactor(ionTabBar): remove tab.shown and tab.hidden events

Instead, use `on-select` and `on-deselect` attribute callbacks.

Alternatively, listen for $scope.$on('$destroy') in a controller inside
your tab.
This commit is contained in:
Andy Joslin
2014-03-17 14:41:51 -06:00
parent e0681590ab
commit b630214fdf
2 changed files with 0 additions and 8 deletions

View File

@@ -218,8 +218,6 @@ function($scope, $ionicViewService, $rootScope, $element) {
*
* Each ionTab has its own view history.
*
* Whenever a tab is shown or hidden, it will broadcast a 'tab.shown' or 'tab.hidden' event.
*
* @usage
* ```html
* <ion-tab
@@ -308,9 +306,6 @@ function($rootScope, $animate, $ionicBind, $compile, $ionicViewService) {
tabsCtrl.$tabsElement.append($compile(tabNavElement)($scope));
$scope.$watch('$tabSelected', function(value) {
if (!value) {
$scope.$broadcast('tab.hidden', $scope);
}
childScope && childScope.$destroy();
childScope = null;
childElement && $animate.leave(childElement);
@@ -320,7 +315,6 @@ function($rootScope, $animate, $ionicBind, $compile, $ionicViewService) {
childElement = tabContent.clone();
$animate.enter(childElement, tabsCtrl.$element);
$compile(childElement)(childScope);
$scope.$broadcast('tab.shown', $scope);
}
});