Skip to content
This repository has been archived by the owner on Sep 2, 2023. It is now read-only.

[FIX] fix use of $validate #2356

Merged
merged 1 commit into from
Mar 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/js/tabs/exchange.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ ExchangeTab.prototype.angular = function (module)
setImmediate(function() {
if ($scope.exchangeForm.amount !== undefined) {
$scope.$apply(function() {
$scope.exchangeForm.amount.$setViewValue($scope.exchange.amount);
$scope.exchangeForm.amount.$validate();
// $scope.exchangeForm.amount.$validate();
// hack - use of private method. this is because rpAmount and other
// validators not real validators, but parsers.
// and latest angular does not call parsers on $validate.
// when rpAmount and others changed to validators this can be changed
// back to $validate
$scope.exchangeForm.amount.$$parseAndValidate();
runUpdateExchangeIfNeeded();
});
}
Expand Down
9 changes: 7 additions & 2 deletions src/js/tabs/send.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ SendTab.prototype.angular = function (module)
setImmediate(function() {
if ($scope.sendForm && $scope.sendForm.send_amount !== undefined) {
$scope.$apply(function() {
$scope.sendForm.send_amount.$setViewValue($scope.send.amount);
$scope.sendForm.send_amount.$validate();
// $scope.sendForm.send_amount.$validate();
// hack - use of private method. this is because rpAmount and other
// validators not real validators, but parsers.
// and latest angular does not call parsers on $validate.
// when rpAmount and others changed to validators this can be changed
// back to $validate
$scope.sendForm.send_amount.$$parseAndValidate();
$scope.update_amount();
});
}
Expand Down