Typescript + Html: How to force uppercase in an input field
You can simply add oninput="this.value = this.value.toUpperCase()"
in your <input>
tag and it will instantly convert any input in your input field to Uppercase.
If you're working with ngModel
, you can use ngModelChange
to do it this way with JavaScript's .ToUpperCase().
<input [ngModel]="person.Name" (ngModelChange)="person.Name = $event.toUpperCase()">