Add trackBy to tags

This commit is contained in:
Roman Hotsiy 2016-07-01 16:30:35 +03:00
parent a671d2f005
commit 81d06316ed
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<div class="methods"> <div class="methods">
<div class="tag" *ngFor="let tag of data.tags"> <div class="tag" *ngFor="let tag of data.tags;trackBy:trackByTagName">
<div class="tag-info" [attr.tag]="tag.name"> <div class="tag-info" [attr.tag]="tag.name">
<h1 class="sharable-header"> <a class="share-link" href="#tag/{{tag.name | encodeURIComponent}}"></a>{{tag.name}} </h1> <h1 class="sharable-header"> <a class="share-link" href="#tag/{{tag.name | encodeURIComponent}}"></a>{{tag.name}} </h1>
<p *ngIf="tag.description" [innerHtml]="tag.description | marked"> </p> <p *ngIf="tag.description" [innerHtml]="tag.description | marked"> </p>

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
import { Component, provide } from '@angular/core'; import { Component } from '@angular/core';
import { import {
inject, inject,
async, async,

View File

@ -46,4 +46,8 @@ export class MethodsList extends BaseComponent {
trackByPointer(idx, el) { trackByPointer(idx, el) {
return el.pointer; return el.pointer;
} }
trackByTagName(idx, el) {
return el.name;
}
} }