Angular TitleCasePipe –
The TitleCasePipe is used to converts the text (string type data) in which the first alphabet of each word is made capital latter and the rest will be in the small case letter.
The expression with titlecase -
{{ value_expression | titlecase }}
The example as,
import { Component } from '@angular/core';
@Component({
selector: 'titlecase-pipe',
template: `<div>
<input type="text" #name (keyup)="changetitlecase(name.value)">
<p>titlecase - <h2>'{{value | titlecase}}'</h2>
</div>`
})
export class titlecasePipeComponent {
value: string;
changetitlecase(value: string) {
this.value = value;
}
}
For more detail kindly refer this link click…