From 790f8a4fdfe552f815ab89f09138bc935dd7854b Mon Sep 17 00:00:00 2001 From: Mateus Konageski Date: Mon, 26 Sep 2016 13:03:26 -0300 Subject: [PATCH] Allow ui-negative-number in ui-percentage-mask In percentage mask, analise the tag ui-negative-number e correct value and mask --- src/global/percentage/percentage.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/global/percentage/percentage.js b/src/global/percentage/percentage.js index ba6a8409..659c17ba 100644 --- a/src/global/percentage/percentage.js +++ b/src/global/percentage/percentage.js @@ -77,9 +77,7 @@ function PercentageMaskDirective($locale, $parse, PreFormatters, NumberMasks) { var actualNumber = parseFloat(modelMask.apply(valueToFormat)); if (angular.isDefined(attrs.uiNegativeNumber)) { - var isNegative = (value[0] === '-'); - - isNegative = (value.slice(-1) === '-') ? !isNegative : isNegative; + var isNegative = (value.slice(-1) === '-') ? !(value[0] === '-') : (value[0] === '-'); if (isNegative) { actualNumber *= -1; formatedValue = '-' + formatedValue;