Malik Kashmiri Malik Kashmiri - 26 days ago 4x
TypeScript Question

Custom Search in Angular 2


I am trying to implement search in angular 2 but I have no clue how to do it. I already go to different tutorials but they all not fit in my case. I have a table in which user are shown now I want to search user on Name/Email. give me some good ideas how I can do this and also some implemented solution so I will view it.


enter image description here


here I write a code for search pipe

import {Pipe} from '@angular/core';

    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));