What is the need of Angular Pipes code example
Example 1: pipes in angular 11
<p>{{name | lowercase}}</p>
<p>{{name | uppercase}}</p>
<p>{{name | titlecase}}</p>
<p>{{birthday | date}}</p>
<p>{{value | currency: ERU}}</p>
Example 2: angular pipes
import {Pipe, PipeTransform} from '@angular/core';
@Pipe ({
name : 'sqrt'
})
export class SqrtPipe implements PipeTransform {
transform(val : number) : number {
return Math.sqrt(val);
}
}
import { SqrtPipe } from './app.sqrt';
declarations: [
SqrtPipe,
],