You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request
Current behavior
When creating a FormControl currently there is no way to specify the type within the FormControl or Group. (ie string, number, boolean, etc).
accountName: new FormControl("", []), This should be a string
'chequeNumber: new FormControl(0, []),' This should be a number, however it can change later to a string by a simple assignment.
The only way I know how to set the type is to set the HTML input type <input matInput placeholder="Cheque Number" formControlName="chequeNumber" type="number" min="0" (blur)="formatNumber()" required>
It would be nice to be able to set the Types for each FormControl individually,
chequeNumber: new FormControl(number, 0, [])
Minimal reproduction of the problem with instructions
N/A
What is the motivation / use case for changing the behavior?
With specifying the type for a FormControl, the control will now know its type and offer it's associated functions, validation etc
Since Reactive Forms focus on explicit management, the type of each FormControl should be explicit as well and not rely on the initial value or the type specified in the HTML
Environment
N/A
Browser:
N/A
For Tooling issues:
N/A
Others:
The text was updated successfully, but these errors were encountered:
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request
Current behavior
When creating a
FormControl
currently there is no way to specify the type within the FormControl or Group. (ie string, number, boolean, etc).accountName: new FormControl("", []),
This should be a string'chequeNumber: new FormControl(0, []),' This should be a number, however it can change later to a string by a simple assignment.
The only way I know how to set the type is to set the HTML input type
<input matInput placeholder="Cheque Number" formControlName="chequeNumber" type="number" min="0" (blur)="formatNumber()" required>
Or use a class with the values and their types
Expected behavior
It would be nice to be able to set the Types for each
FormControl
individually,chequeNumber: new FormControl(number, 0, [])
Minimal reproduction of the problem with instructions
N/A
What is the motivation / use case for changing the behavior?
With specifying the type for a
FormControl
, the control will now know its type and offer it's associated functions, validation etcSince Reactive Forms focus on explicit management, the type of each FormControl should be explicit as well and not rely on the initial value or the type specified in the HTML
Environment
N/A
Browser:
N/A
For Tooling issues:
N/A
Others:
The text was updated successfully, but these errors were encountered: