Skip to content

Instantly share code, notes, and snippets.

@JesusMurF
Last active March 22, 2019 15:07
Show Gist options
  • Save JesusMurF/6bb8d64e309732a98e3c to your computer and use it in GitHub Desktop.
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
.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;
};
});
@cesasol
Copy link

cesasol commented Oct 13, 2016

Eres un santo!

@JesusMurF
Copy link
Author

Muchas gracias! :)

@andresgardiol
Copy link

Me sirvió muchímo, te agradezco

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