Wallet/js/controllers/createProfile.js

21 lines
603 B
JavaScript
Raw Normal View History

2014-09-30 21:16:46 -03:00
'use strict';
2014-11-29 18:35:48 -03:00
angular.module('copayApp.controllers').controller('CreateProfileController', function($scope, $rootScope, $location, notification, pluginManager, identityService) {
identityService.goWalletHome();
$scope.loading = false;
2014-09-30 21:16:46 -03:00
$scope.createProfile = function(form) {
2014-10-09 18:53:31 -03:00
if (form && form.$invalid) {
$scope.error('Error', 'Please enter the required fields');
2014-10-09 18:53:31 -03:00
return;
}
2014-11-30 00:31:17 -03:00
identityService.create(
form.email.$modelValue, form.password.$modelValue, function(err) {
if (err) $scope.error('Error', err.toString());
$rootScope.$digest();
});
2014-09-30 21:16:46 -03:00
}
});