Simple filter in ionic / angular

03:17:00 0 Comments



/// first create duplicate temp variable of variable used in the forloop


onSearch(evt: any) {
        console.log(evt.target.value);
        const val = evt.target.value;
        this.usersList = [];
   
        const temp = this.tempUsers.filter(function(d) {
      return String(d.ecn).toLowerCase().indexOf(val) !== -1 ||
      d.fullname.toLowerCase().indexOf(val) !== -1 ||
      d.gender.toLowerCase() === val ||
      d.department.toLowerCase().indexOf(val) !== -1 ||
      String(d.doj).toLowerCase().indexOf(val) !== -1 || !val;
    });

    // update the rows
    this.usersList = temp;
    }

Joel

Joel Fernandes,I am a Very Smart,Innovative Creative and One of the Best Webdevelopers.I am an expert in Webdevelopment.My other interest include Cars and Vehicles.My desire is to be the best and serve you with the best information I have .I will always share all my tips and tricks on this website and provide you with the best themes so that your life may be simpler.Keep visiting www.joelwebsites.com for the best website related ,tips and tricks and news.Meet me on FaceBook

0 comments: