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>
33< button md-button (click) ="tabLinks.shift() "> Remove tab</ button >
44< button md-button (click) ="swapTabLinks() "> Swap first two</ button >
55< button md-button (click) ="addToLabel() "> Add to labels</ button >
6+ < button md-button (click) ="toggleBackground() "> Toggle background</ button >
67
78< 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 " >
910 < a md-tab-link
1011 *ngFor ="let tabLink of tabLinks; let i = index "
1112 [routerLink] ="tabLink.link "
@@ -247,3 +248,31 @@ <h1>Inverted tabs</h1>
247248 </ div >
248249 </ md-tab >
249250</ 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 {
1616 { label : 'Fog' , link : 'foggy-tab' } ,
1717 ] ;
1818
19+ tabNavBackground : any = undefined ;
20+
1921 // Standard tabs demo
2022 tabs = [
2123 {
@@ -93,6 +95,10 @@ export class TabsDemo {
9395 addToLabel ( ) {
9496 this . tabLinks . forEach ( link => link . label += 'extracontent' ) ;
9597 }
98+
99+ toggleBackground ( ) {
100+ this . tabNavBackground = this . tabNavBackground ? undefined : 'primary' ;
101+ }
96102}
97103
98104
You can’t perform that action at this time.
0 commit comments