Using Pipes
Pipes are like a transform, they take data as input and transforms it to the desired output. A basic example of using pipes is shown below:
Passing Parameters
A pipe can accept optional parameters to modify the output. To pass parameters to a pipe, simply add a colon
and the parameter
value to the end of the pipe expression:
You can also pass multiple parameters this way:
In the above example, we are using CurrencyPipe
, DecimalPipe
and LowerCasePipe
together to display product prices appropriately. The price value of 100.123456
is displayed as ca$100.1235
using both pipes in conjunction.
Chaining Pipes
We can chain pipes together to make use of multiple pipes in one expression.
Last updated