use scope only - preferences (advanced)

This commit is contained in:
Javier 2016-06-13 16:13:35 -03:00
commit 9163127dca
22 changed files with 238 additions and 305 deletions

View file

@ -1,21 +1,19 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesEmailController',
function($rootScope, go, profileService, gettext, $log, walletService) {
this.save = function(form) {
var self = this;
this.error = null;
angular.module('copayApp.controllers').controller('preferencesEmailController', function($rootScope, go, profileService, walletService) {
$scope.save = function(form) {
$scope.error = null;
$scope.saving = true;
var fc = profileService.focusedClient;
var email = $scope.email || '';
var fc = profileService.focusedClient;
var email = self.email || '';
walletService.updateRemotePreferences(fc, {
email: email,
}, function(err) {
if (!err)
$rootScope.$emit('Local/EmailUpdated', email);
go.path('preferences');
});
};
});
walletService.updateRemotePreferences(fc, {
email: email,
}, function(err) {
$scope.saving = false;
if (!err)
$rootScope.$emit('Local/EmailUpdated', email);
go.path('preferences');
});
};
});