Hello Devs,
In this tutorial, we will learn Angular Uppercase Pipe Example | Uppercase Pipe in Angular 9/8/7
In this section, you will understand a concept of to uppercase pipe angular. it's simple example of uppercase pipe angular 9.
Follow this step by step guide below.
Syntax:
{{ value_expression | uppercase }}
Uppercase Pipe Example:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<div>
<p>{{ myString | uppercase }}</p>
</div>`,
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular';
myString = "This is Angular Uppercase Pipe Example";
}
Output
THIS IS ANGULAR UPPERCASE PIPE EXAMPLE
Uppercase Pipe with Input Example:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<div>
<input (input) = "setDataOnChange($event.target.value)">
<p>{{ myString | uppercase }}</p>
</div>`,
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular';
myString = "";
setDataOnChange(value){
this.myString = value;
}
}
May this example help you.