Last active
January 8, 2017 20:58
-
-
Save pietmichal/77dd03f303a5f575b6e2583efba1f1d5 to your computer and use it in GitHub Desktop.
Medium tutorial part5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| onTabClick(tab: TabComponent) { | |
| this.currentTab = tab; | |
| } | |
| isSelected(tab: TabComponent) { | |
| return this.currentTab.name === tab.name; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <span | |
| *ngFor="let tab of tabList" | |
| [ngClass]="{selected: isSelected(tab)}" | |
| (click)="onTabClick(tab)" | |
| > | |
| {{tab.name}} | |
| </span> | |
| <div><template [ngTemplateOutlet]="currentTab.templateRef"></template></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment