File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed
spa/src/app/shared/hca-tab Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 11< div class ="wrapper ">
22 < ng-container *ngIf ="tabs ">
33 < div class ="hca-tabs ">
4- < div [ngClass] ="getTabClass(activeTab.key, tab.key) " *ngFor ="let tab of tabs " (click) ="onClickTab(tab) ">
4+ < div *ngFor ="let tab of tabs;trackBy: trackByFn "
5+ [ngClass] ="getTabClass(activeTab.key, tab.key) "
6+ (click) ="onClickTab(tab) ">
57 {{tab.displayName}}
68 </ div >
79 </ div >
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ import {
1414// App dependencies
1515import EntitySpec from "../../files/shared/entity-spec" ;
1616
17- // App dependencies
18-
1917@Component ( {
2018 selector : "hca-tab" ,
2119 templateUrl : "./hca-tab.component.html" ,
@@ -32,10 +30,6 @@ export class HCATabComponent {
3230 // Outputs
3331 @Output ( ) tabSelected = new EventEmitter < EntitySpec [ ] > ( ) ;
3432
35- /**
36- * Public API
37- */
38-
3933 /**
4034 * Return the set of CSS class names that are applicable to the tab.
4135 *
@@ -61,4 +55,16 @@ export class HCATabComponent {
6155 this . tabSelected . emit ( tab ) ;
6256 }
6357
58+ /**
59+ * Track by function used when displaying the set of tabs.
60+ *
61+ * @param {number } index
62+ * @param {EntitySpec } tab
63+ * @returns {string }
64+ */
65+ public trackByFn ( index : number , tab : EntitySpec ) : string {
66+
67+ return tab . key ;
68+ }
69+
6470}
You can’t perform that action at this time.
0 commit comments