Skip to content

Instantly share code, notes, and snippets.

@hkwid
Last active January 7, 2016 14:23
Show Gist options
  • Select an option

  • Save hkwid/5c5d8c2b77fe97f26373 to your computer and use it in GitHub Desktop.

Select an option

Save hkwid/5c5d8c2b77fe97f26373 to your computer and use it in GitHub Desktop.
angularjs/tickFilter.js
angular.module('app')
.filter('tick', function () {
var map = {
'0': '×',
'1': '○'
};
return function(input) {
if (typeof input == 'undefined'){
return '';
} else {
return map[input];
}
};
});
@hkwid
Copy link
Copy Markdown
Author

hkwid commented Jan 7, 2016

{{1 | tick}}

// result
'○'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment