Skip to content
Snippets Groups Projects
Select Git revision
  • eecd2ced593f2c21f541e86654ef59170660eff6
  • master default protected
  • chrome-manifest-v3
  • feature/migrate-cordova-13
  • feat/improve-network-scan
  • feat/force-migration-check
  • develop
  • feature/encrypted_comment
  • feature/android_api_19
  • gitlab_migration_1
  • rml8
  • v1.7.15-rc1
  • v1.7.14
  • v1.7.13
  • v1.7.12
  • v1.7.11
  • v1.7.10
  • v1.7.9
  • v1.7.8
  • v1.7.7
  • v1.7.6
  • v1.7.5
  • v1.7.4
  • v1.7.3
  • v1.7.2
  • v1.7.1
  • v1.7.0
  • v1.7.0-rc2
  • v1.7.0-rc1
  • v1.6.12
  • v1.6.11
31 results

app-controllers.js

Blame
  • app-controllers.js 6.56 KiB
    
    angular.module('cesium.app.controllers', ['cesium.services'])
    
      .config(function($httpProvider) {
        'ngInject';
    
        //Enable cross domain calls
        $httpProvider.defaults.useXDomain = true;
    
        //Remove the header used to identify ajax call  that would prevent CORS from working
        delete $httpProvider.defaults.headers.common['X-Requested-With'];
      })
    
      .config(function($stateProvider) {
        'ngInject';
    
        $stateProvider
    
          .state('app', {
            url: "/app",
            abstract: true,
            templateUrl: "templates/menu.html",
            controller: 'AppCtrl'
          })
        ;
    
      })
    
      .controller('AppCtrl', AppController)
    
      .controller('PluginExtensionPointCtrl', PluginExtensionPointController)
    
    ;
    
    
    /**
     * Useful controller that could be reuse in plugin, using $scope.extensionPoint for condition rendered in templates
     */
    function PluginExtensionPointController($scope, PluginService) {
      'ngInject';
      $scope.extensionPoint = PluginService.extensions.points.current.get();
    }
    
    /**
     * Abstract controller (inherited by other controllers)
     */
    function AppController($scope, $rootScope, $ionicModal, $state, $ionicSideMenuDelegate, UIUtils, $q, $timeout,
      CryptoUtils, BMA, Wallet, APP_CONFIG, $ionicHistory, Device, $ionicPopover, $translate, $filter,
      Modals
      ) {
      'ngInject';
    
      $scope.search = { text: '', results: {} };
      $scope.config = APP_CONFIG;
      if (!$rootScope.walletData) {
        $rootScope.walletData = Wallet.data;
      }
    
      ////////////////////////////////////////
      // Load currencies
      ////////////////////////////////////////
    
      $scope.loadCurrencies = function() {
        return $q(function (resolve, reject){
          if (!!$rootScope.knownCurrencies) { // get list only once
            resolve($rootScope.knownCurrencies);
            return;
          }
          $rootScope.knownCurrencies = [];
          BMA.blockchain.parameters()