Wallet/js/controllers/backup.js
2014-06-16 16:46:17 -03:00

33 lines
812 B
JavaScript

'use strict';
angular.module('copayApp.controllers').controller('BackupController',
function($scope, $rootScope, $location, $window, $timeout, $modal, backupService) {
$scope.title = 'Backup';
$scope.download = function() {
backupService.download($rootScope.wallet);
};
$scope.openModal = function() {
var modalInstance = $modal.open({
templateUrl: 'backupModal.html',
controller: ModalInstanceCtrl,
});
modalInstance.result.then(function(email) {
backupService.sendEmail(email, $rootScope.wallet);
});
};
});
var ModalInstanceCtrl = function($scope, $modalInstance) {
$scope.submit = function(form) {
$modalInstance.close($scope.email);
};
$scope.cancel = function() {
$modalInstance.dismiss('cancel');
};
};