Answers for "angular pipe usage"

0

pipe in angular

//app.html:
<h1>pipe in angular</h1>
<h3>{{pipe | lowercase}}</h3>
<h3>{{pipe | uppercase}}</h3>
<h3>{{pipe | titlecase}}</h3>
<h3>{{pipe | slice:1:10}}</h3>
<h3>{{today | date:'fullDate'}}</h3>
<h3>{{val | currency:'INR'}}</h3>
<h3>{{val | currency:'USD'}}</h3>
<h3>{{val | currency:'CAD'}}</h3>

//app.component.ts:
 pipe = 'Hello World!';
  today=Date.now()
  val=48
Posted by: Guest on March-03-2022
0

use of pipe

import {Observable, range} from 'rxjs';
import {map, filter} from 'rxjs/operators';

const source$: Observable<number> = range(0, 10);

source$.pipe(
    map(x => x * 2),
    filter(x => x % 3 === 0)
).subscribe(x => console.log(x));
Posted by: Guest on September-17-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language