File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ <h1>Tab Nav Bar</h1>
3
3
< button md-button (click) ="tabLinks.shift() "> Remove tab</ button >
4
4
< button md-button (click) ="swapTabLinks() "> Swap first two</ button >
5
5
< button md-button (click) ="addToLabel() "> Add to labels</ button >
6
+ < button md-button (click) ="toggleBackground() "> Toggle background</ button >
6
7
7
8
< div class ="demo-nav-bar ">
8
- < nav md-tab-nav-bar aria-label ="weather navigation links ">
9
+ < nav md-tab-nav-bar aria-label ="weather navigation links " [background] =" tabNavBackground " >
9
10
< a md-tab-link
10
11
*ngFor ="let tabLink of tabLinks; let i = index "
11
12
[routerLink] ="tabLink.link "
@@ -247,3 +248,31 @@ <h1>Inverted tabs</h1>
247
248
</ div >
248
249
</ md-tab >
249
250
</ md-tab-group >
251
+
252
+ < h1 > Accent tabs</ h1 >
253
+ < md-tab-group class ="demo-tab-group " color ="accent ">
254
+ < md-tab label ="Earth ">
255
+ < div class ="tab-content ">
256
+ This tab is about the Earth!
257
+ </ div >
258
+ </ md-tab >
259
+ < md-tab label ="Fire ">
260
+ < div class ="tab-content ">
261
+ This tab is about combustion!
262
+ </ div >
263
+ </ md-tab >
264
+ </ md-tab-group >
265
+
266
+ < h1 > Tabs with background color</ h1 >
267
+ < md-tab-group class ="demo-tab-group " background ="primary " color ="accent ">
268
+ < md-tab label ="Earth ">
269
+ < div class ="tab-content ">
270
+ This tab is about the Earth!
271
+ </ div >
272
+ </ md-tab >
273
+ < md-tab label ="Fire ">
274
+ < div class ="tab-content ">
275
+ This tab is about combustion!
276
+ </ div >
277
+ </ md-tab >
278
+ </ md-tab-group >
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ export class TabsDemo {
16
16
{ label : 'Fog' , link : 'foggy-tab' } ,
17
17
] ;
18
18
19
+ tabNavBackground : any = undefined ;
20
+
19
21
// Standard tabs demo
20
22
tabs = [
21
23
{
@@ -93,6 +95,10 @@ export class TabsDemo {
93
95
addToLabel ( ) {
94
96
this . tabLinks . forEach ( link => link . label += 'extracontent' ) ;
95
97
}
98
+
99
+ toggleBackground ( ) {
100
+ this . tabNavBackground = this . tabNavBackground ? undefined : 'primary' ;
101
+ }
96
102
}
97
103
98
104
You can’t perform that action at this time.
0 commit comments