Skip to content

Instantly share code, notes, and snippets.

@funnierinspanish
Created August 14, 2014 16:10
Show Gist options
  • Save funnierinspanish/92d421bbf77b3a075b54 to your computer and use it in GitHub Desktop.
Save funnierinspanish/92d421bbf77b3a075b54 to your computer and use it in GitHub Desktop.
Filtro para AngularJS para convertir valores booleanos (1-0,true-false) en cadenas de texto legibles, "falso" y "verdadero"
function filtroBooleanos () {
return function (input) {
if(input === false || input == 0){
return "falso";
}else if(input === true || input == 1){
return "verdadero"
}
}
}
angular
.module('app')
.filter('filtroBooleanos', filtroBooleanos);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment