sort
Observable
'dan gelen öğelerin bir listesi ve async pipe
'u kullanmanın en iyi yolu nedir? (Özel bir sıralama boru yapım gerçekten verimli olmadığını okuyun.) Ben sadece zaman uyumsuz borusunu kullanarak abone olduğunu ve böylece verilerin yerel bir kopyasını tutmak ve önlemek istiyorum ...Köşeli 2 - Gözat listesinden sıralama listesi
//can I use map here and filter items right in the observable and get rid of subscribe?
this.test$ = Observable.of(['one', 'two', 'three'])
.subscribe((data) => {
data.sort((a, b) => {
return a < b ? -1 : 1;
});
this.data = data;
});
şablonu:
<div *ngFor='let item of data'>
<!-- want to be able to use async pipe here -->
Teşekkür Günter ile zaman uyumsuz boru kullanabilirsiniz takdir ediyorum. – Thibs