show only when it is ready

This commit is contained in:
Jean-Baptiste Dominguez 2018-08-08 15:52:20 +09:00
commit 6981a5af9f
2 changed files with 4 additions and 1 deletions

View file

@ -21,6 +21,8 @@ angular.module('bitcoincom.directives')
},
templateUrl: 'views/includes/formatted-amount.html',
controller: function($scope, $timeout) {
$scope.canShow = false;
if (!$scope.currency && $scope.value) { // If there is no currency available..
// Try to extract currency from value..
var currencySplit = $scope.value.split(" ");
@ -120,6 +122,7 @@ angular.module('bitcoincom.directives')
}
break;
}
$scope.canShow = true;
};
formatNumbers($scope.currency, $scope.value);

View file

@ -1,4 +1,4 @@
<div class="formatted-amount"
ng-class="{ 'size-equal': displaySizeEqual }">
ng-class="{ 'size-equal': displaySizeEqual }" ng-show="canShow">
<span ng-if="start.length > 0" class="start">{{start}}</span><span ng-if="middle.length > 0" class="middle">{{middle}}</span><span ng-if="end.length > 0" class="end">{{end}}</span><span ng-if="currency.length > 0" class="currency">{{currency}}</span>
</div>