Pipes help change how data looks in your app. Pipe chaining lets you use many pipes one after another to change data step by step.
Pipe chaining in Angular
{{ value | pipe1 | pipe2 | pipe3 }}Each pipe changes the data and passes it to the next pipe.
Use the | symbol to chain pipes in your template.
{{ birthday | date:'shortDate' | uppercase }}{{ userName | lowercase | slice:0:10 }}{{ price | currency:'USD' | lowercase }}{{ message | lowercase | titlecase }}This Angular component shows how to chain pipes in the template. It formats a date fully and then makes it uppercase. It also converts a username to lowercase and then shows only the first 5 characters.
import { Component } from '@angular/core'; @Component({ selector: 'app-pipe-chaining', template: ` <h2>Pipe Chaining Example</h2> <p>Original date: {{ birthday }}</p> <p>Formatted and uppercase date: {{ birthday | date:'fullDate' | uppercase }}</p> <p>Original text: '{{ userName }}'</p> <p>Lowercased and sliced text: '{{ userName | lowercase | slice:0:5 }}'</p> ` }) export class PipeChainingComponent { birthday = new Date(1990, 4, 15); // May 15, 1990 userName = 'AngularLearner'; }
Pipe chaining runs pipes left to right, passing the result of one pipe to the next.
Time complexity depends on each pipe used; simple pipes run fast.
Common mistake: forgetting that each pipe receives the output of the previous one, so order matters.
Use pipe chaining when you want to apply multiple simple transformations in a clear, readable way.
Pipes change how data looks in Angular templates.
Pipe chaining lets you apply many pipes one after another.
Order of pipes matters because each pipe uses the previous pipe's output.