Creating Custom Pipes in Angular | Angular Pipes | Angular 13+

preview_player
Показать описание
In this lecture you are going to learn how to create a custom pipe in Angular. The Pipes are a great way to transform the appearance of elements in the template. The Angular comes with some great built-in pipes like Date pipe, Currency pipe, and Number pipe, etc. But if these pipes do not cover your needs, then we can create our own custom pipe in Angular.

To create a custom pipe, first we need to create a pipe class. The pipe class must implement the PipeTransform interface. We also decorate it with @pipe decorator. Give a name to the pipe under name metadata of the @pipe decorator. Finally, we create the transform method, which transforms given value to the desired output.

Let's learn how to create and use a custom pipe in Angular.

Рекомендации по теме
Комментарии
Автор

Sir, the playlist was shuffled this video was appearing before the built in pipes once check the order.

Chakree
Автор

Sir can we also use StudentService and get the totalMarks in transform method instead of passing totalMarks as the parameter for the pipe

aarifsaifi