Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use a pipe in Angular Material?

How to use a pipe in Angular Material? I'd like to fill a placeholder in a mat-select via a pipe. The pipe I programmed works, but when I try to use it with Angular Material elements it doesn't work. I can use a Variable to fill the Placeholder, but why does an expression for pipes not work?

<input readonly matInput [matDatepicker]="picker1" placeholder="{{lblStartDatum}}" [(ngModel)]="StartAuswahl" (ngModelChange)="onDateChanged(1)">

this works!

<!--input readonly matInput [matDatepicker]="picker1" placeholder="{{TranslatedItems | menuItem:"lblZeitraumVon"}}" [(ngModel)]="StartAuswahl" (ngModelChange)="onDateChanged(1)"-->

This does not work.

like image 890
smalldevice Avatar asked Dec 31 '25 05:12

smalldevice


1 Answers

In my project:

value="{{totalProjectCost | currency}}" 

Make sure to use the double quotes.

like image 73
Logan_B Avatar answered Jan 06 '26 04:01

Logan_B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!