diff --git a/ionic/components/tabs/tabs.ts b/ionic/components/tabs/tabs.ts index 2cd9feace6..9f438f68bd 100644 --- a/ionic/components/tabs/tabs.ts +++ b/ionic/components/tabs/tabs.ts @@ -1,4 +1,5 @@ import {Directive, ElementRef, Optional, Host, forwardRef, ViewContainerRef, HostListener} from 'angular2/core'; +import {EventEmitter, Output} from 'angular2/core'; import {NgFor, NgIf} from 'angular2/common'; import {Ion} from '../ion'; @@ -68,6 +69,8 @@ import {rafFrames} from '../../util/dom'; ] }) export class Tabs extends Ion { + @Output() change: EventEmitter = new EventEmitter(); + /** * Hi, I'm "Tabs". I'm really just another Page, with a few special features. * "Tabs" can be a sibling to other pages that can be navigated to, which those @@ -163,6 +166,7 @@ export class Tabs extends Ion { selectedTab.load(opts, () => { selectedTab.emitSelect(); + this.change.emit(selectedTab); if (selectedTab.root) { // only show the selectedTab if it has a root diff --git a/ionic/components/tabs/test/advanced/index.ts b/ionic/components/tabs/test/advanced/index.ts index aa8a195ad3..7d4ebb0771 100644 --- a/ionic/components/tabs/test/advanced/index.ts +++ b/ionic/components/tabs/test/advanced/index.ts @@ -63,6 +63,10 @@ class TabsPage { console.log('Chat clicked!'); this.modal.open(ChatPage); } + + onTabChange() { + console.log('onTabChange'); + } } diff --git a/ionic/components/tabs/test/advanced/tabs.html b/ionic/components/tabs/test/advanced/tabs.html index 849275406a..0194f13161 100644 --- a/ionic/components/tabs/test/advanced/tabs.html +++ b/ionic/components/tabs/test/advanced/tabs.html @@ -1,5 +1,5 @@ - +