我在客户端完成了管道过滤,如“使用jHipster进行完整堆栈开发”中所述。 它适用于字符串值,但不适用于数字。可能吗? 以及如何按范围进行过滤?
此代码有效:
clients-rating.component.html
<input class="form-control input-sm" id="inputsm1" type="search" [(ngModel)]="filter">
<tr *ngFor="let clientsRating of (clientsRatings | pureFilter:filter:'visitCount'); trackBy: trackId">
<td>{{clientsRating.visitCount}}</td>
</tr>
clients-rating.component.ts
@Component({
selector: 'jhi-clients-rating',
templateUrl: './clients-rating.component.html',
styleUrls: ['./clients-rating.css']
})
export class ClientsRatingComponent implements OnInit, OnDestroy {
filter: String;
constructor()
......
}