W3cubDocs

/Angular 2

LowerCasePipe

Stable Pipe

What it does

Transforms string to lowercase.

How to use

expression | lowercase

NgModule

CommonModule

Description

Converts value into a lowercase string using String.prototype.toLowerCase().

Example

@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 {
  value: string;
  change(value: string) { this.value = value; }
}

exported from @angular/common/index defined in @angular/common/src/pipes/lowercase_pipe.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/common/index/LowerCasePipe-pipe.html