Select Git revision
app-controllers.js
-
Benoit Lavenier authored
- settings: add an extension point - ES : settings : add ES node address edition (and fix when applying) - ES: refactoring ES service name - ES : registry record: add socials network edition - ES: focus on first field
Benoit Lavenier authored- settings: add an extension point - ES : settings : add ES node address edition (and fix when applying) - ES: refactoring ES service name - ES : registry record: add socials network edition - ES: focus on first field
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()