Is it possible to apply multiple filters with PipeTransform?
I attempted the following:
posts;
postss;
transform(items: any[]): any[] {
if (items && items.length)
this.posts = items.filter(it => it.library = it.library.replace("WH","Warehouse"));
this.postss = items.filter(it => it.collection = it.collection.replace("CL","Central Library"));
return this.posts,this.postss;
}
Unfortunately, this approach did not yield the desired results.
However,
posts;
transform(items: any[]): any[] {
if (items && items.length)
this.posts = items.filter(it => it.library = it.library.replace("WH","Warehouse"));
return this.posts;
}
this alternative method proved to be successful.