@@ -3,6 +3,7 @@ import {EventEmitter, Input, Output} from 'angular2/core';
3
3
4
4
import { IonicApp } from '../app/app' ;
5
5
import { Config } from '../../config/config' ;
6
+ import { isTrueProperty } from '../../util/util' ;
6
7
import { Keyboard } from '../../util/keyboard' ;
7
8
import { NavController , NavOptions } from '../nav/nav-controller' ;
8
9
import { ViewController } from '../nav/view-controller' ;
@@ -133,6 +134,8 @@ export class Tab extends NavController {
133
134
*/
134
135
public isSelected : boolean ;
135
136
private _isInitial : boolean ;
137
+ private _isEnabled : boolean = true ;
138
+ private _isShown : boolean = true ;
136
139
private _panelId : string ;
137
140
private _btnId : string ;
138
141
private _loaded : boolean ;
@@ -144,35 +147,61 @@ export class Tab extends NavController {
144
147
btn : TabButton ;
145
148
146
149
/**
147
- * @input {Page} Set the root page for this tab
150
+ * @input {Page} Set the root page for this tab.
148
151
*/
149
152
@Input ( ) root : Type ;
150
153
151
154
/**
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.
153
156
*/
154
157
@Input ( ) rootParams : any ;
155
158
156
159
/**
157
- * @input {string} Set the title of this tab
160
+ * @input {string} The title of the tab button.
158
161
*/
159
162
@Input ( ) tabTitle : string ;
160
163
161
164
/**
162
- * @input {string} Set the icon for this tab
165
+ * @input {string} The icon for the tab button.
163
166
*/
164
167
@Input ( ) tabIcon : string ;
165
168
166
169
/**
167
- * @input {string} Set the badge for this tab
170
+ * @input {string} The badge for the tab button.
168
171
*/
169
172
@Input ( ) tabBadge : string ;
170
173
171
174
/**
172
- * @input {string} Set the badge color for this tab
175
+ * @input {string} The badge color for the tab button.
173
176
*/
174
177
@Input ( ) tabBadgeStyle : string ;
175
178
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
+
176
205
/**
177
206
* @output {Tab} Method to call when the current tab is selected
178
207
*/
0 commit comments