I am currently programming an Angular4 application and facing a challenge with how to handle an array that contains values along with their corresponding pipe types (regions, language or number).
const values = [
{ value: 'us', pipe: 'regions'},
{ value: 'en', pipe: 'language'},
{ value: '100', pipe: 'number'},
.....
];
I need to use ngFor to display the values while applying the correct pipes. Here's what I've tried:
<li *ngFor="let item of values"> {{item.value | item.pipe}} </li>
I attempted to create a class called FacetConfiguration and inject the pipe object into it, but this approach did not work as expected.
Is there a better way to achieve this? Any other ideas would be greatly appreciated.
P.S. I have a large list of configurations, each requiring a different pipe type, so hard coding them all would be quite challenging.
Thank you!