What is the best way to sort a list of items coming from an Observable and still be able to use the async pipe? (I read that making a cust
sort
Observable
async pipe
If you call .subscribe() you get a Subscription, the async pipe expects an Observable.
.subscribe()
Subscription
If you change it to
this.test$ = Observable.of(['one', 'two', 'three']) .map((data) => { data.sort((a, b) => { return a < b ? -1 : 1; }); return data; });
you can use the async pipe with test$
test$