@workInProgress @ngdoc overview @name Tutorial: Step 9 @description
| {@link tutorial.step_8 Previous} | {@link http://angular.github.com/angular-phonecat/step-9/app Example} | {@link tutorial Tutorial Home} | {@link https://github.com/angular/angular-phonecat/commit/975d173ad0768487852387497c086f3c93fb48f6 Code Diff} | {@link tutorial.step_10 Next} |
... ...In the phone details template, we employ our filter for angular expressions whose values are "true" or "false"; `{{ [phone_feature] | checkmark }}`: __`app/partials/phone-detail.html`.__
![]()
{{phone.name}}
{{phone.description}}
...
/* http://docs.angularjs.org/#!angular.filter */
angular.filter('checkmark', function(input) {
return input ? '\u2713' : '\u2718';
});
## Discussion:
This example shows how easy it is to roll your own filters for displaying data. As explained in
the "Writing your own Filters" section of the {@link angular.filter angular.filter} page, you
simply add your filter function on to the `angular.filter` object.
In this example, our filter name is "checkmark"; our input is either "true" or "false", and we
return one of two unicode characters we have chosen to represent true or false (`\u2713` and
`\u2718`).
| {@link tutorial.step_8 Previous} | {@link http://angular.github.com/angular-phonecat/step-9/app Example} | {@link tutorial Tutorial Home} | {@link https://github.com/angular/angular-phonecat/commit/975d173ad0768487852387497c086f3c93fb48f6 Code Diff} | {@link tutorial.step_10 Next} |