-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tab hidden/shown event should give index of tab hidden/shown #634
Comments
Fixes ionic-team#634. Fixes ionic-team#334. Fixes ionic-team#175. fixes ionic-team#646.
Fixes ionic-team#634. Fixes ionic-team#334. Fixes ionic-team#175. fixes ionic-team#646.
These events are broadcasted only to child scopes of a tab, not from $rootScope. That was a bug. If you wish to detect (in nightly or 0.9.26), do this: <ion-tabs ng-controller="MyCtrl">
...
</ion-tabs> function MyCtrl($scope) {
$scope.$watch('tabsController.selectedTab', function(tab) {
var index = $scope.tabsController.getTabIndex(tab);
//dosomething
});
}
Documentation is a very high priority and will be coming soon! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
I'm currently using one controller to handle all my tabs (they are dynamically generated). In this case it would be very helpful to know which tab got selected when the shown/hidden event is fired.
For me the index would be fine.
All that's needed as far as I can tell is that the code for the tab directive after
$scope.$watch('isVisible', function(value) {
is changed fromto
The text was updated successfully, but these errors were encountered: