Last active
January 8, 2017 20:58
-
-
Save pietmichal/77dd03f303a5f575b6e2583efba1f1d5 to your computer and use it in GitHub Desktop.
Revisions
-
Michał Pietraszko revised this gist
Jan 8, 2017 . 2 changed files with 8 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ 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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ <span *ngFor="let tab of tabList" [ngClass]="{selected: isSelected(tab)}" (click)="onTabClick(tab)" > {{tab.name}} </span> <div><template [ngTemplateOutlet]="currentTab.templateRef"></template></div> -
Michał Pietraszko created this gist
Jan 8, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ onTabClick(tabName: string) { this.currentTab = this.tabList.find(t => t.name === tabName); } isSelected(tabName: string) { return this.currentTab.name === tabName; } 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ <span *ngFor="let t of tabList" [ngClass]="{selected: isSelected(t.name) }" (click)="onTabClick(t.name)" > {{t.name}} </span> <div><template [ngTemplateOutlet]="currentTab.templateRef"></template></div>