@@ -3,6 +3,7 @@ import {EventEmitter, Input, Output} from 'angular2/core';
33
44import { IonicApp } from '../app/app' ;
55import { Config } from '../../config/config' ;
6+ import { isTrueProperty } from '../../util/util' ;
67import { Keyboard } from '../../util/keyboard' ;
78import { NavController , NavOptions } from '../nav/nav-controller' ;
89import { ViewController } from '../nav/view-controller' ;
@@ -133,6 +134,8 @@ export class Tab extends NavController {
133134 */
134135 public isSelected : boolean ;
135136 private _isInitial : boolean ;
137+ private _isEnabled : boolean = true ;
138+ private _isShown : boolean = true ;
136139 private _panelId : string ;
137140 private _btnId : string ;
138141 private _loaded : boolean ;
@@ -144,35 +147,61 @@ export class Tab extends NavController {
144147 btn : TabButton ;
145148
146149 /**
147- * @input {Page} Set the root page for this tab
150+ * @input {Page} Set the root page for this tab.
148151 */
149152 @Input ( ) root : Type ;
150153
151154 /**
152- * @input {object} Any nav-params you want to pass to the root page of the tab
155+ * @input {object} Any nav-params to pass to the root page of this tab.
153156 */
154157 @Input ( ) rootParams : any ;
155158
156159 /**
157- * @input {string} Set the title of this tab
160+ * @input {string} The title of the tab button.
158161 */
159162 @Input ( ) tabTitle : string ;
160163
161164 /**
162- * @input {string} Set the icon for this tab
165+ * @input {string} The icon for the tab button.
163166 */
164167 @Input ( ) tabIcon : string ;
165168
166169 /**
167- * @input {string} Set the badge for this tab
170+ * @input {string} The badge for the tab button.
168171 */
169172 @Input ( ) tabBadge : string ;
170173
171174 /**
172- * @input {string} Set the badge color for this tab
175+ * @input {string} The badge color for the tab button.
173176 */
174177 @Input ( ) tabBadgeStyle : string ;
175178
179+ /**
180+ * @input {boolean} If the tab is enabled or not. If the tab
181+ * is not enabled then the tab button will still show, however,
182+ * the button will appear grayed out and will not be clickable.
183+ * Defaults to `true`.
184+ */
185+ @Input ( )
186+ get enabled ( ) : boolean {
187+ return this . _isEnabled ;
188+ }
189+ set enabled ( val : boolean ) {
190+ this . _isEnabled = isTrueProperty ( val ) ;
191+ }
192+
193+ /**
194+ * @input {boolean} If the tab button is visible within the
195+ * tabbar or not. Defaults to `true`.
196+ */
197+ @Input ( )
198+ get show ( ) : boolean {
199+ return this . _isShown ;
200+ }
201+ set show ( val : boolean ) {
202+ this . _isShown = isTrueProperty ( val ) ;
203+ }
204+
176205 /**
177206 * @output {Tab} Method to call when the current tab is selected
178207 */
0 commit comments