Great! The product price changed from a number to a formatted currency. How does it work?
- AngularJS gets the value of
- It sends this number into the
currency filter. The pipe symbol (
|) takes the output on the left and "pipes" it to the right.
- 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.