add tests and fix some minor issues
This commit is contained in:
parent
433f1570de
commit
8b25b5932f
3 changed files with 29 additions and 6 deletions
|
|
@ -1,20 +1,18 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('UriPaymentController', function($rootScope, $scope, $routeParams) {
|
||||
var data = $routeParams.data;
|
||||
var data = decodeURIComponent($routeParams.data);
|
||||
var splitDots = data.split(':');
|
||||
$scope.protocol = splitDots[0];
|
||||
data = splitDots[1];
|
||||
var splitQuestion = data.split('?');
|
||||
$scope.address = splitQuestion[0];
|
||||
data = decodeURIComponent(splitQuestion[1]);
|
||||
var search = splitQuestion[1];
|
||||
data = JSON.parse('{"' + search.replace(/&/g, '","').replace(/=/g, '":"') + '"}',
|
||||
function(key, value) {
|
||||
return key === "" ? value : decodeURIComponent(value);
|
||||
});
|
||||
$scope.amount = data.amount;
|
||||
$scope.amount = parseInt(data.amount);
|
||||
$scope.message = data.message;
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue