How to make input appear as sentence case based on typing using Angular 8 ? Last Updated : 17 Dec, 2020 Comments Improve Suggest changes Like Article Like Report In this example, we will see how to make input appear sentence case based on typing using angular8. Approach: First, we need to write code for the input type in the HTML file.After writing the input type as text in HTML, using two-way binding i.e., using ngModel we can bind the value of the input field.Now in order to make the input field sentence case, we can use the ngModelChange event to manipulate the value according to the requirement.Make sure you are importing 'FormsModule' from '@angular/forms'.After importing the module now we need to implement the function in the ts file where we can modify the input value using regex according to the requirement like sentence case and can display in the input field.Once the above steps are done, start, or serve the project to run. Code Implementation: app.component.ts: JavaScript import { Component } from '@angular/core'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { inputvalue = '' changeToSentenceCase(event) { this.inputvalue = event.replace(/\b\w/g, event => event.toLocaleUpperCase()); } } app.component.html: HTML <p>Type in textbox to make as sentence case.</p> <input type='text' [(ngModel)]="inputvalue" (ngModelChange)="changeToSentenceCase($event)"> app.module.ts: JavaScript import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; @NgModule({ imports: [BrowserModule, FormsModule], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } Output: Comment More infoAdvertise with us Next Article How to make sure clients have enough words in textarea by using angularjs in order to disable/enable a button? B bunnyram19 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Misc Similar Reads How to use Pipes within ngModel on input Element in Angular ? The ngModel directive is a directive that is used to bind the values of the HTML controls (input, select, and textarea) or any custom form controls, and stores the required user value in a variable and we can use that variable whenever we require that value. In this article, we will learn about Usin 3 min read How to make sure clients have enough words in textarea by using angularjs in order to disable/enable a button? The Task here is to make sure that the user enters enough words in the Textarea. The button will be enabled or disabled on the basis of the word count entered by the client or user. Here the word limit will be set by admin of the project or Application. If word count lies between the parameter set b 4 min read How to make sure clients have enough words in textarea by using angularjs in order to disable/enable a button? The Task here is to make sure that the user enters enough words in the Textarea. The button will be enabled or disabled on the basis of the word count entered by the client or user. Here the word limit will be set by admin of the project or Application. If word count lies between the parameter set b 4 min read How to make sure clients have enough words in textarea by using angularjs in order to disable/enable a button? The Task here is to make sure that the user enters enough words in the Textarea. The button will be enabled or disabled on the basis of the word count entered by the client or user. Here the word limit will be set by admin of the project or Application. If word count lies between the parameter set b 4 min read How to truncate the text using Angular Pipe and Slice ? Angular Pipe and Slice can be used to manipulate or transform the data in a specific format. Angular Pipes can be utilized to format or transform data directly before displaying it in the Angular template. The Slice is a built-in method in JavaScript that enables the users to extract a part of the a 3 min read How to get input value search box and enter it in AngularJS component using Enter key ? In this article, we will see how to get an input value entered in the search box using Enter key in AngularJS. To implement a search component in AngularJS that calls the function whenever the user presses the enter key(keyCode = 13) and then does some relatable task from the user input. This can be 3 min read Like