Details
Currently, I am working on implementing a search functionality using pipes. Users should be able to search by email, first name, or last name. At the moment, it only works for searching by email. I am looking to extend this capability so that users can search using any of these three criteria.
Image
https://i.sstatic.net/pnteM.png
Custom Search Pipe
import {Pipe} from '@angular/core';
@Pipe({
name: "search"
})
export class SearchPipe {
transform(value, term) {
console.log(term + ' ' + value);
if (term == null) {
return null;
}
return value.filter((item) => item.Email.includes(term));
}
}
Response
{
"Id":1,
"ApimId":"1",
"FirstName":"Super",
"LastName":"Admin","
"Email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aecfc6c3cbcaeec9c3cfc7c280cdc1c3">[email protected]</a>"
}