есть код склонения слов от чисел, но не могу понять как сделать чтобы склонялся от чисел счетчика, и выводился
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script data-require="angular.js@1.5.8" data-semver="1.5.8" src="https://code.angularjs.org/1.5.8/angular.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
<script type="text/javascript">
angular.module("CounterApp", []).controller("CounterController1", function($scope) {
$scope.a = 0;
$scope.b = 0;
$scope.c = 0;
$scope.decrementA = function() {
if ($scope.a > 0) $scope.a--;
}
$scope.decrementB = function() {
if ($scope.b > 0) $scope.b--;
}
$scope.decrementC = function() {
if ($scope.c > 0) $scope.c--;
}})
var Lang = {};
Lang.GetNoun = function(number, one, two, five) {
number = Math.abs(number);
number %= 100;
if (number >= 5 && number <= 20) {
return five;
}
number %= 10;
if (number == 1) {
return one;
}
if (number >= 2 && number <= 4) {
return two;
}
return five;
}
function showText(n) {
var text = n + " " +
Lang.GetNoun(n, "штука", "штуки", "штук");
..........
}
</script>
</head>
<body>
<div ng-app="CounterApp" ng-controller="CounterController1">
<div class="counter1">
<button class="butcount1" ng-click="decrementA()">-</button> {{a}}
<button ng-click="a = a + 1">+</button>
</div>
<div class="counter2">
<button ng-click="decrementB()">-</button> {{b}}
<button ng-click="b = b + 1">+</button>
</div>
<div class="counter3">
<button ng-click="decrementC()">-</button> {{c}}
<button ng-click="c = c + 1">+</button>
</div>
<div class="sum">Итого: {{ a + b + c }}</div>
</div>
</body>
</html>