angular.module('igTruncate', []).filter('truncate', function (){
  return function (text, length, end){
    if (text !== undefined){
      if (isNaN(length)){
        length = 10;
      }

      if (end === undefined){
        end = "...";
      }

      if (text.length <= length || text.length - end.length <= length){
        return text;
      }else{
        return String(text).substring(0, length - end.length) + end;
      }
    }
  };
});

@@ -192,60 +192,27 @@
     
-if (
 end =
-== undefined)%7B%0A        end = %22...%22;%0A      %7D
+ end %7C%7C %22...%22;
 %0A%0A  

Simplify default for end variable.