July 2017
Intermediate to advanced
454 pages
10h 1m
English
A pipe can take parameters as well. We can pass parameters along with the pipe. A parameter is separated with a colon symbol (:) after the pipe:
{{appValue | Pipe1: parameter1: parameter2 }}
Let's quickly build a simple example of a pipe to see it in action. Here's an example of DatePipe with the MM-dd-yyyy parameters:
{{today | date:'MM-dd-yyyy' }}
One more example of a pipe with parameters is given as follows:
{{salary | currency:'USD':true}}
Let's analyze the preceding code snippet in detail:
Read now
Unlock full access