What is a parameterized pipe?

A pipe can accept any number of optional parameters to fine-tune its output. The parameterized pipe can be created by declaring the pipe name with a colon ( : ) and then the parameter value. If the pipe accepts multiple parameters, separate the values with colons. Let's take a birthday example with a particular format(dd/MM/yyyy):

import { Component } from '@angular/core';
selector: 'app-birthday',
template: `<p>Birthday is {{ birthday | date: 'dd/MM/yyyy' }}</p>`, // 18/06/1987
export class BirthdayComponent {
birthday = new Date(1987, 6, 18);

Note: The parameter value can be any valid template expression, such as a string literal or a component property.

April 23, 2022