create profile working!

This commit is contained in:
Matias Alejo Garcia 2014-09-30 21:16:46 -03:00
commit 7a2906c8d1
12 changed files with 139 additions and 43 deletions

View file

@ -35,8 +35,8 @@ angular.module('copayApp.controllers').controller('CopayersController',
};
$scope.deleteWallet = function() {
var w = $rootScope.wallet;
identity.delete(w.id, function() {
var w = $rootScope.iden;
iden.deleteWallet(w.id, function() {
controllerUtils.logout();
});
};

View file

@ -0,0 +1,24 @@
'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);
});
}
});