Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Angular Custom Pipes

In the previous posts we saw about the built-in pipes in Angular, their syntax, usage, chaining etc. Angular also provides us the ability to create our own Custom pipes to suite our requirement. When we cannot use any of the built-in pipes for our requirement we can create a custom Pipe. Also for larger applications, create custom pipes helps in reusing code/functionality.

Custom pipes are nothing but classes like Components and custom Directives, Custom pipe classes use the @Pipe decorator. The pipe class implements the PipeTransforminterface's transform method that accepts an input value followed by optional parameters and returns the transformed value.

While creating the custom pipe class, use the @Pipe decorator and specify the name of the custom pipe as follows.


This post first appeared on C# Guide, please read the originial post: here

Share the post

Angular Custom Pipes

×

Subscribe to C# Guide

Get updates delivered right to your inbox!

Thank you for your subscription

×