-3

I am using angular 4 for my front end.My project consist of many components and each component consist of forms and inputs.

Is there any way to convert each and every letter user entered to my input fields to capital letters.

I think previous answers will not match my project as I'm having hundreds of input fields I am looking for a easy way to convert every inputs to capital when the user enter.

Thanks in advance

Saurabh Agrawal
  • 7,581
  • 2
  • 27
  • 51
Shyamal
  • 161
  • 1
  • 2
  • 17
  • you can make this using css. – Azeez Kallayi Dec 27 '17 at 08:34
  • 2
    Possible duplicate of [How to convert input value to uppercase in angular 2 (value passing to ngControl)](https://stackoverflow.com/questions/35826325/how-to-convert-input-value-to-uppercase-in-angular-2-value-passing-to-ngcontrol) – Aravind Dec 27 '17 at 08:34
  • try https://www.concretepage.com/angular-2/angular-2-uppercase-pipe-and-lowercase-pipe-example – core114 Dec 27 '17 at 08:41
  • Please be specific and search over internet. Please read https://stackoverflow.com/help/how-to-ask – Ajay Dec 27 '17 at 08:46

2 Answers2

3

While binding the expression in view you can use toUpperCase() function

Try this

<hello name="{{name.toUpperCase() }}"></hello>    
<input type="text" [(ngModel)]="name">

Here is the working solution

Saurabh Agrawal
  • 7,581
  • 2
  • 27
  • 51
-1

You can use simple css code to convert it.

Selector{
text-transform:uppercase;
}