I\'m trying to build a dynamic table where i wand to decide in run time which pipe to use (If Any).
I\'m trying to achieve something similar to (Sim
You can't apply pipes dynamically. What you can do is to build a "meta" pipe that decides what transformation(s) to do.
@Pipe({
name: 'meta'
})
class MetaPipe implements PipeTransform {
transform(val, pipes:any[]) {
var result = val;
for(var pipe of pipes) {
result = pipe.transform(result);
}
return result;
}
}
and then use it like
{{cell.content | meta:[cell.pipe]}}