'use strict';
ordinalSuffixFilter.$inject = ['ordinalSuffix'];
module.exports = ['$filterProvider', function ($filterProvider) {
'ngInject';
function ordinalSuffixFilter(ordinalSuffix) {
'ngInject';
return function (day) {
if (angular.isNumber(day) && isFinite(day)) {
return ordinalSuffix(Number(day));
}
};
}
$filterProvider.register('sqOrdinalSuffix', ordinalSuffixFilter);
}];
In the given example ordinalSuffixFilter.$inject = ['ordinalSuffix']; is defined on the wrong scope therefore it leads to "undefined variable orfinalSuffixFilter" error. I believe that in order to avoid such errors annotations should be added directly above the annotated function.
Input code:
Output code:
In the given example
ordinalSuffixFilter.$inject = ['ordinalSuffix'];
is defined on the wrong scope therefore it leads to "undefined variable orfinalSuffixFilter" error. I believe that in order to avoid such errors annotations should be added directly above the annotated function.