Last active
March 22, 2019 15:07
-
-
Save JesusMurF/6bb8d64e309732a98e3c to your computer and use it in GitHub Desktop.
Filtro para Angular.js que elimina las tildes a los textos y los cambia a minúsculas
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
.filter('slugify', function(){ | |
return function(input){ | |
var tittles = "ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç"; | |
var original = "AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuunncc"; | |
for (var i = 0; i < tittles.length; i++) { | |
input = input.replace(tittles.charAt(i), original.charAt(i)).toLowerCase(); | |
}; | |
return input; | |
}; | |
}); |
Muchas gracias! :)
Me sirvió muchímo, te agradezco
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Eres un santo!