There is a way to send a Pipe to Component? I have a component that displays data, and I want to let the user choose which pipe he wants to use to display the data, for example:
<app-my-component value="abcde" [pipe]="UpperCasePipe"></app-my-component>
<app-my-component value="0.95" [pipe]="PercentPipe"></app-my-component>
<app-my-component [value]="[1,2,3,4]" [pipe]="MySummarizePipe"></app-my-component>
So, what I need is something like this:
@Component({
selector: 'app-my-component',
template: `
<span>{{value|pipe}}</span>
`
})
export class MyComponent {
@Input() value: any;
@Input() pipe: any;
}