O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using formatters as filters

Formatters are helper tools to view your data differently from how they are stored in the model. Angular has built-in formatters, for example, Date to format date-times, Currency to format money data, and LimitTo to limit the view to a certain number of results. The Filter class displays items based on whether they satisfy the criteria set up in the filter. Sorting works through an orderBy attribute in ng-repeat. In this recipe, we will show you how to use filters to make different views on your data possible. You can follow along with the code in the project angular_formatter.

How to do it...

The job listing is now preceded by an input field; when you start typing the job type, the list of only those jobs that start ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required