A pipe takes in the data as input and transforms it into the desired output. Pipes are declared using @Pipe decorator. We will create a custom pipe here, in this article.
The @Pipe decorator tells Angular, "This is a special class that can transform data in templates." Use pipes to make your apps UI cleaner and easier to manage.

The pipe decorator will tell angular how to inject this file into your application. This decorator allows you to give your pipe a name and set the pipe to pure or impure.

To create a Custom pipe, Create a pipe class which implements the PipeTransform interface. Decorate it with @pipe decorator &.create the transform method.