Open MikhailRatner opened 2 years ago
Same issue here. min
and max
attributes are only supported on input
controls with type="number"
(and a few other types) but not type="string"
, which is the default when you don't supply a type and is the type required for currencyMask
to work correctly.
Here's an example that will cause this error, and min/max do not work:
<input name="customercost" min="0" max="500" [(ngModel)]="cost" matInput required currencyMask />
If I remove currencyMask and change type="number", then min and max work correctly:
<input name="customercost" min="0" max="500" [(ngModel)]="cost" matInput required type="number" />
I am on Angular 14 and the
min
andmax
attributes do not work. Changing thetype
andinputmode
of the input field does not have any effect. The error I get is:Type 'string' is not assignable to type 'number'.ngtsc(2322)
I am using this on a an input field connected to a
FormControl
, so via Reactive Forms not Template Driven Forms.