From 3e473b494e330b3584f40ce5ed7dfff6f8dd90b4 Mon Sep 17 00:00:00 2001 From: mhartington Date: Thu, 3 Dec 2015 17:41:46 -0500 Subject: [PATCH] docs(tab) --- ionic/components/tabs/tab.ts | 64 ++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/ionic/components/tabs/tab.ts b/ionic/components/tabs/tab.ts index 1ce3c73d90..c498420628 100644 --- a/ionic/components/tabs/tab.ts +++ b/ionic/components/tabs/tab.ts @@ -9,6 +9,16 @@ import {Tabs} from './tabs'; /** + * @name Tab + * @usage + * ```html + * + * + * + * + * ``` + * + * @description * _For basic Tabs usage, see the [Tabs section](../../../../components/#tabs) * of the Component docs._ * @@ -21,36 +31,12 @@ import {Tabs} from './tabs'; * * See the [Tabs API reference](../Tabs/) for more details on configuring Tabs * and the TabBar. + * - * Like Nav, you must set a root page to be loaded initially for each Tab with - * the 'root' property: - * ``` - * import {GettingStartedPage} from 'getting-started'; - * @App({ - * template: ` - * - * - * ` - * }) - * class MyApp { - * constructor(){ - * this.tabOneRoot = GettingStartedPage; - * this.tabTwoRoot = GettingStartedPage; - * } - * } - * ``` - *

Tab Properties

- * The Tabs component automatically creates the TabBar from the properties you - * set on each Tab. - * - * To change the title and icon, use the `tab-title` and `tab-icon` - * inputs: - * ```html - * - * - * - * - * ``` + * @property [root] - set the root page for this tab + * @property [tab-title] - set the title of this tab + * @property [tab-icon] - set the icon for this tab + */ @Component({ selector: 'ion-tab', @@ -148,6 +134,9 @@ export class Tab extends NavController { }); } + /** + * @private + */ setSelected(isSelected) { this.isSelected = isSelected; this.hideNavbars(!isSelected); @@ -163,10 +152,27 @@ export class Tab extends NavController { }); } + /** + * + * ```ts + * export class MyClass{ + * constructor(tab: Tab){ + * this.tab = tab; + * console.log(this.tab.index); + * } + * } + * ``` + * + * @returns {Number} Returns the index of this page within its NavController. + * + */ get index() { return this.parent.getIndex(this); } + /** + * @private + */ onDestroy() { clearTimeout(this._loadTimer); }