Open In App

Angular10 LowerCasePipe

Last Updated : 28 Apr, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we are going to see what is LowerCasePipe in Angular 10 and how to use it.

The LowerCasePipe is used to Transforms all the text to lowercase.

Syntax:

{{ value | lowercase }}

NgModule: Module used by LowercaseCasePipe is:

  • CommonModule

Approach:

  • Create the angular app to be used
  • There is no need for any import for the LowerCasePipe to be used
  • In app.component.ts define the variables that takes the LowerCasePipe value.
  • In app.component.html use the above syntax with ‘|’ symbol to make LowerCasePipe element.
  • serve the angular app using ng serve to see the output

Input value:

  • value: it takes an string value.

Example 1:

app.component.ts




import { Component, OnInit } 
        from '@angular/core';
  
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    // Key Value object
    value : string = 'GEEKSFORGEEKS';
  }


app.component.html




<b>
  <div>
    LowerCase value is :
    {{value |lowercase}}
  </div>
</b>


Output:

Example 2:

app.component.ts




import { Component, OnInit } 
        from '@angular/core';
  
@Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
})
export class AppComponent {
    // Key Value object
    value : string = 'GeeksforGeeks';
  }


app.component.html




<b>
  <div>
    CamelCase value is :
    {{value}}
  </div>
  <div>
    LowerCase value is : 
    {{value |lowercase}}
  </div>
</b>


Output:


Reference:https://angular.io/api/common/LowerCasePipe



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads