How do you sort an Observable in Angular 6 with rxjs 6?

It is:

this.http.get<Category[]>(this.endpoint).pipe(
  map(results => results.sort(...))
);

Or since sort modifies existing array, it’s more semantically correct to provide side effects in do/tap:

this.http.get<Category[]>(this.endpoint).pipe(
  tap(results => {
    results.sort()
  })
);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)