Developer Guide: Templates: Understanding Angular Filters

Angular filters format data for display to the user. In addition to formatting data, filters can also modify the DOM. This allows filters to handle tasks such as conditionally applying CSS styles to filtered output.

For example, you might have a data object that needs to be formatted according to the locale before displaying it to the user. You can pass expressions through a chain of filters like this:

    name | uppercase

The expression evaluator simply passes the value of name to angular.filter.uppercase().

In addition to formatting data, filters can also modify the DOM. This allows filters to handle tasks such as conditionally applying CSS styles to filtered output.

Related Topics

Related API