Building Custom Pipes
Learn how to create custom pipes in an Angular application.
We'll cover the following
In this lesson, we are going to dive deeper into how we can build a pipe to provide custom transformations to data bindings. We will create a pipe that sorts our list of products by name.
Sorting data by building a custom pipe
To create a new pipe, we use the generate
command of the Angular CLI, passing the word pipe
and its name as parameters:
Note: The command below is for creating a pipe on the local machine using the Angular CLI.
Get hands-on with 1400+ tech skills courses.