This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

LowerCasePipe

Transforms text to all lower case.

{{ value_expression | lowercase }}
      
      {{ value_expression | lowercase }}
    

NgModule

Input value

value string

The string to transform to lower case.

See also

Usage notes

The following example defines a view that allows the user to enter text, and then uses the pipe to convert the input text to all lower case.

@Component({ selector: 'lowerupper-pipe', template: `<div> <label>Name: </label><input #name (keyup)="change(name.value)" type="text"> <p>In lowercase: <pre>'{{value | lowercase}}'</pre> <p>In uppercase: <pre>'{{value | uppercase}}'</pre> </div>` }) export class LowerUpperPipeComponent { // TODO(issue/24571): remove '!'. value !: string; change(value: string) { this.value = value; } }
      
      
  1. @Component({
  2. selector: 'lowerupper-pipe',
  3. template: `<div>
  4. <label>Name: </label><input #name (keyup)="change(name.value)" type="text">
  5. <p>In lowercase: <pre>'{{value | lowercase}}'</pre>
  6. <p>In uppercase: <pre>'{{value | uppercase}}'</pre>
  7. </div>`
  8. })
  9. export class LowerUpperPipeComponent {
  10. // TODO(issue/24571): remove '!'.
  11. value !: string;
  12. change(value: string) { this.value = value; }
  13. }