In this article we will learn about Chaining Pipes in Angular. Pipes can be chained together to make use of multiple pipes in one expression. Please read my previous article Parameterized Pipes in Angular.
The chaining Pipe is used to perform the multiple operations within the single expression. This chaining operation will be chained using the pipe (|).
Example-1
In the following example, to display the birthday in the upper case- will need to use the inbuilt date-pipe and upper-case-pipe.
export class AppComponent {
birthday : Date= new Date();
}
<p> Unforamtted : {{ birthday }} </p>
<p> Formatted with use only one pipe : {{ birthday | date }} </p>
<p> Formatted with use chain pipe : {{ birthday | date | uppercase}} </p>
You can see on below, on the last row we can use chain pipes. We used both of the pipes date
& uppercase
that’s called chain pipes.

Example-2
export class AppComponent {
name : string= '';
}
On below we use slicepipe and uppercase to display string in uppercase after slicing operation.
<label for="usr">Pipe Test:</label>
<input type="text" [(ngModel)]="name" class="form-control col-sm-6" id="usr">
<br>
<h5>Result with chaining:</h5>
<p>{{name | slice:1:12 | uppercase}}</p>

On the above image you can see the it slice the letter one from first space and maximum characters 12 shows.
Conclusion
In this article we will learn aboutĀ Chaining Pipes in Angular. Pipes can be chained together to make use of multiple pipes in one expression.
Leave behind your valuable queries, suggestions in the comment section below. Also, if you think this article help to you, do not forget to share this within your developer community. Happy Coding š
Related Articles
- How to deploy Angular App in Azure Static Web App
- How to create a react App
- React Installation and Environment Setup
- Intro to ReactJS Application
- Global Error Handling in Angular
- How to host Angular app on AWS S3 bucket using CloudFront
- How to Deploy Angular App in GitHub Pages
- C Programming- Recursion in C
- C Program to Add Two Numbers Using Functions
- Steps to create Azure Resource Group
Jayant Tripathy
Coder, Blogger, YouTuberA passionate developer keep focus on learning and working on new technology.