【发布时间】:2016-02-17 15:39:44
【问题描述】:
我有一段代码。
<table class="table table-bordered table-condensed" cellpadding="0" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr *ngFor="#participant of participants; #i = index">
<td>{{i+1}}</td>
<td>{{participant.username}}</td>
<td>{{participant.score}}</td>
</tr>
</tbody>
</table>
在 Angular 1 中,我有 orderBy 过滤器来按我的过滤器对行进行排序。但是我怎样才能以同样的方式在 Angular 2 中进行 orderBy 呢?谢谢。
【问题讨论】:
-
Angular 2 OrderBy Pipe 的可能重复项另请参阅angular.io/docs/ts/latest/guide/pipes.html 以了解一般管道
标签: javascript angular