Created
August 14, 2014 16:10
-
-
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"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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