Converting to uppercase via pipe in Angular
Using the UpperCasePipe pipe, you can convert a string to lowercase. Let's try it in practice. Let's say we have the following string in the component class:
export class AppComponent {
name: string = 'john';
}
Let's output our string in the template file, using our channel in it:
<div>
{{ name | uppercase }}
</div>
Result of code execution:
<div>
JOHN
</div>
Let's say you have an array:
export class AppComponent {
users: string[] = ['john', 'alex', 'kate', 'mary'];
}
Print each array element in uppercase.