Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11631

Angular - PipeTransform - Filter observable array

$
0
0

I have a problem when creating a PipeTransform, the input is Observable<Array> and I want to filter this Array it based on another parameter, but it doesn't work.Any help where I'm going wrong?

export class FilterClientPipe implements PipeTransform {  transform(clients: Observable<ClientModel[]>, i1: string): any {    if (i1 !== '') {      clients = clients.pipe(        map((data: ClientModel[]) =>          data            .filter(i => i.i1.toLowerCase() === i1)        ));      return clients;    }    return clients;  }}

Viewing all articles
Browse latest Browse all 11631

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>