close
filterTest (input_p: any) {
// get array property
this.tmep_lcc = this.data.map(x => x.LCC );
console.log('get array property');
console.log(this.tmep_lcc);
// distinct array property
this.tmep_lcc = Array.from(new Set (this.data.map(x => x.LCC )));
console.log('distinct array property');
console.log( this.tmep_lcc);
// with sort
this.tmep_lcc = Array.from(new Set (this.data.map(x => x.LCC ))).sort();
console.log('sort');
console.log(this.tmep_lcc);
// filter array by input value
this.temp_data = this.data.filter(x => x.LCC.startsWith(input_p)); // 不用加data : x.data.toLowerCase()
}
全站熱搜
留言列表