I have an input like below, bounded with a reactive form control:
<mat-form-field appearance="fill" floatLabel="always" fxFlex>
<mat-label>My field</mat-label>
<input
matInput
#input="matInput"
[formControl]="amountControl"
[errorStateMatcher]="customMatcher"
/>
<mat-error *ngIf="amountControl?.invalid">{{ getErrorMessage$() | async }}</mat-error>
</mat-form-field>
Now, after the user enters a value, the value needs to be formatted, possibly on blur or custom keyboard shortcut, filled back into the html input field, and updated into the bounded form control with the formatted value.
I was thinking of using pipes, but then, it seems to be useful only to change how a value is displayed, but not save it back to the backing formControl.
What would be the correct approach to do this?