I have data, which I have bind in html table,
Order ID is number type, I want to convert this into string before binding to table in Angular 10.
Example :
I have data, which I have bind in html table,
Order ID is number type, I want to convert this into string before binding to table in Angular 10.
Example :
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Sep 2, 2021, 8:25 AM EDT
Rohit Gautam26 reputationPosted Sep 2, 2021, 8:39 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Sep 2, 2021, 9:31 AM EDT
Rohit Gautam26 reputationPosted Sep 3, 2021, 2:04 AM EDT
I have added the custom pipe, It's not working.
After i search it just blank the table
below is my code:
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'searchfilter'
})
export class SearchfilterPipe implements PipeTransform {
// transform(value: unknown, ...args: unknown[]): unknown {
// return null;
// }
transform(items: any[], searchedKeyword: any): any[] {
if (!items) return [];
if (!searchedKeyword) return items;
searchedKeyword = searchedKeyword.toLowerCase();
return items.filter(it => {
return it.toString().toLowerCase().includes(searchedKeyword); // see here
});
}
}