preferences.controller.js 788 B

1234567891011121314151617181920212223242526
  1. angular.module('odoo')
  2. .controller('PreferencesController', function (
  3. $scope,
  4. $state,
  5. $ionicPopup,
  6. userStorageFactory
  7. ) {
  8. $scope.deleteAccount = function () {
  9. $ionicPopup.prompt({
  10. title: 'Confirmar',
  11. template: 'Escriba ELIMINAR en el cuadro de abajo para confirmar',
  12. inputType: 'text',
  13. inputPlaceholder: 'ELIMINAR'
  14. }).then(function (answer) {
  15. if (answer == 'ELIMINAR') {
  16. userStorageFactory.remove(function (ok) {
  17. $state.go('configuration');
  18. }, function (err) {
  19. $ionicPopup.alert({ title: 'No se ha podido eliminar el cliente', template: JSON.stringify(err) });
  20. });
  21. }
  22. });
  23. }
  24. });