Code Editor
Web Browser
Your First App

Filters II

Great! The product price changed from a number to a formatted currency. How does it work?

  1. AngularJS gets the value of product.price.
  2. It sends this number into the currency filter. The pipe symbol (|) takes the output on the left and "pipes" it to the right.
  3. The filter outputs a formatted currency with the dollar sign and the correct decimal places.

In this way, filters help to separate the content in the controller from its presentation in the view.

Report a Bug
If you see a bug or any other issue with this page, please report it here.