How can I format the data for viewing purposes while maintaining its original value?
I have created a method to format the value:
formatGroupName(groupAnalysisList: SelectItem[]) : any {
groupAnalysisList.forEach((group:SelectItem)=>
{group.label = group.label.toLowerCase().replace(/(?:^|\s)(?!da|de|do|e)\S/g, l
=> l.toUpperCase());
});
return groupAnalysisList;
};
I am using this method in my HTML code :
[options]="formatGroupName(groupAnalysisList)"
For example, if I have a word like "DOLAR", I format it as "Dolar". However, I still want to keep the original value "DOLAR" in my TypeScript file.