I'd like to only allow upper case letters, so using [A-Z], obviously lower case letters are now simply discarded. Is there a way I could simply convert lower case letters to upper case on the fly?
It's possible to use a pipe that upper-cases all entries. The code for the pipe could be something like:
function upperCasePipe(conformedValue) {
return conformedValue.toUpperCase()
}
Thanks for your question!
How do you then use the pipe?
It depends on the framework component that you're using. You can start by reading the README.md of the framework component that you're using which will then lead you to this documentation page, which contains information about using pipe.
Got it working thanks :)
Awesome!
Just in case it might help someone, with angular2 I just have the following function in my component:
public toUpperCase(conformedValue: string): string {
return conformedValue.toUpperCase();
}
And in my template I have the this:
<input id="bic" type="text"formControlName="bic" [textMask]="{mask: bicMask, pipe: toUpperCase}" />
Most helpful comment
Just in case it might help someone, with angular2 I just have the following function in my component:
And in my template I have the this: