TypeScript: search item in array by field

Posted by Unknown On Thursday, June 29, 2017 0 comments
  
  public search(name: string): void {
    if (name.trim().length > 0) {
      this.employees = this.employeeSource.filter(x => x.name.toLowerCase().indexOf(name.trim().toLowerCase()) >= 0);
    }
  }  
  
  

0 comments:

Post a Comment