Answer the question
In order to leave comments, you need to log in
How to apply default pipes dynamically?
The task is following:
There is an array of objects. Each object has a pipe: string field. For example, { name: 'Test', pipe: 'lowercase' }.
In view, I display a list of objects and I want the pipe that is specified in the object to be applied to each object.
<span *ngFor="let item of items">{{ item.name | item.pipe }}</span>
Answer the question
In order to leave comments, you need to log in
This is unlikely to happen, because Angular makes binds at the compilation stage. In theory, he should generally give an error on this. So the easiest way is to inject pipes into a component and apply them right there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question