I'm trying to use a filter that reverses a string, this is my code:
app.filter("revertir", function(){ return function(input){ var u = input.length-1; console.log("ENTRA: "+input); for(var i=0;i<input.length/2;i++){ var temp = input[i]; input[i] = input[u]; input[u] = temp; u--; } return input; }; }); I inject this filter into my controller, and it's thrown properly, but I'm not getting the text reversed; it shows up exactly as the input string.
Where's the problem? This exact script for reversing works perfect in a Java test program.