Wallet/js/controllers/createProfile.js

24 lines
729 B
JavaScript
Raw Normal View History

2014-09-30 21:16:46 -03:00
'use strict';
angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, notification, controllerUtils, pluginManager) {
controllerUtils.redirIfLogged();
$scope.createProfile = function(form) {
$scope.loading = true;
copay.Identity.create(form.email.$modelValue, form.password.$modelValue, {
pluginManager: pluginManager,
network: config.network,
networkName: config.networkName,
walletDefaults: config.wallet,
passphrase: config.passphrase,
}, function(err, iden ,w) {
$scope.loading = false;
$rootScope.iden = iden;
$rootScope.wallet = w;
controllerUtils.bindWallet(w, $scope);
});
}
});