Wallet/src/js/controllers/preferencesGlidera.js

47 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-08-28 18:23:24 -03:00
'use strict';
angular.module('copayApp.controllers').controller('preferencesGlideraController',
function($scope, $modal, $timeout, $ionicModal, profileService, applicationService, glideraService, storageService) {
2015-08-28 18:23:24 -03:00
2015-09-07 11:14:09 -03:00
this.getEmail = function(token) {
2015-08-28 18:23:24 -03:00
var self = this;
2015-09-07 11:14:09 -03:00
glideraService.getEmail(token, function(error, data) {
self.email = data;
2015-08-28 18:23:24 -03:00
});
2015-09-07 11:14:09 -03:00
};
2015-08-28 18:23:24 -03:00
2015-09-07 11:14:09 -03:00
this.getPersonalInfo = function(token) {
var self = this;
2015-08-28 18:23:24 -03:00
glideraService.getPersonalInfo(token, function(error, info) {
self.personalInfo = info;
});
2015-09-07 11:14:09 -03:00
};
2015-08-28 18:23:24 -03:00
2015-09-07 11:14:09 -03:00
this.getStatus = function(token) {
var self = this;
glideraService.getStatus(token, function(error, data) {
self.status = data;
2015-08-28 18:23:24 -03:00
});
2015-09-07 11:14:09 -03:00
};
2015-08-28 18:23:24 -03:00
2015-09-07 11:14:09 -03:00
this.getLimits = function(token) {
var self = this;
2015-08-28 18:23:24 -03:00
glideraService.getLimits(token, function(error, limits) {
self.limits = limits;
});
2015-09-07 11:14:09 -03:00
};
2015-08-28 18:23:24 -03:00
2015-09-11 15:39:06 -03:00
this.revokeToken = function(testnet) {
$scope.network = testnet ? 'testnet' : 'livenet';
$scope.loading = false;
$ionicModal.fromTemplateUrl('views/modals/glidera-confirmation.html', {
scope: $scope,
animation: 'slide-in-up'
}).then(function(modal) {
$scope.glideraConfirmationModal = modal;
$scope.glideraConfirmationModal.show();
2015-09-10 14:58:06 -03:00
});
2015-08-28 18:23:24 -03:00
};
});