I'm creating a filter for the angle using the Gulp compiler however I'm having an error and when parsing the compiled code it looks like it's compiling something wrong, what could it be?
Filter:
class StrSplit extends Filter
contructor: ->
return (str, splitChar, splitIndex)->
return '' unless str
str.split(splitChar)[splitIndex]
View:
{{mystr | strSplit:',':0}}
Compiled filter:
StrSplit = (function() {
function StrSplit() {}
StrSplit.prototype.contructor = function() {
return function(str, splitChar, splitIndex) {
if (!str) {
return '';
}
return str.split(splitChar)[splitIndex];
};
};
return StrSplit;
})();
angular.module('ng-utils').filter('strSplit', [StrSplit]);
Error encountered:
Can not interpolate: 2 - {{text_filter | strSplit: ',': 0}} TypeError: Can not read property 'apply' of undefined