Using Filters

A great feature of AngularJS is the capability to implement filters. Filters are a type of provider that hooks into the expression parser and modifies the results of the expression for display in a view—for example, to format time or currency values.

You implement filters inside expressions, using the following syntax:

{{ expression | filter}}

If you chain multiple filters together, they are executed in the order in which you specify them:

{{ expression | filter | filter }}

Some filters allow you to provide input in the form of function parameters. You add these parameters by using the following syntax:

{{ expression | filter:parameter1:parameter2 }}

Also, you can add ...

Get Learning AngularJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.