0
В моей странице у меня есть:AngularJS фильтр с несколькими аргументами
<h1>{{name | fontResize: 25:42}}</h1>
и у меня есть фильтр
angular.module('myApp').filter('fontResize', function() {
return function (text, length, end) {
if (!text) {
return text;
}
if (isNaN(length))
length = 10;
if (end === undefined)
end = "...";
if (text.length <= length || text.length - end.length <= length) {
$('h1').css('fontSize', '30px');
return text;
} else {
$('h1').css('fontSize', '12px');
return text;
}
};
});
Как я установил FontSize для моего второго аргумента (42)?