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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Rohit GautamPosted Sep 3, 2021, 6:04 AM
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
});
}
}
Sachin SinghPosted Sep 2, 2021, 1:31 PM
Rohit GautamPosted Sep 2, 2021, 12:39 PM
Sachin SinghPosted Sep 2, 2021, 12:25 PM