Merge pull request #95 from bitpay/feature/improve-readability
remove old style angular module def
This commit is contained in:
commit
b9fb7b235f
|
@ -1,13 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.address').controller('AddressController',
|
angular.module('insight.address').controller('AddressController',
|
||||||
['$scope',
|
|
||||||
'$rootScope',
|
|
||||||
'$routeParams',
|
|
||||||
'$location',
|
|
||||||
'Global',
|
|
||||||
'Address',
|
|
||||||
'get_socket',
|
|
||||||
function ($scope, $rootScope, $routeParams, $location, Global, Address, get_socket) {
|
function ($scope, $rootScope, $routeParams, $location, Global, Address, get_socket) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
|
@ -33,4 +26,4 @@ angular.module('insight.address').controller('AddressController',
|
||||||
socket.emit('subscribe', $routeParams.addrStr);
|
socket.emit('subscribe', $routeParams.addrStr);
|
||||||
|
|
||||||
$scope.params = $routeParams;
|
$scope.params = $routeParams;
|
||||||
}]);
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.blocks').controller('BlocksController', ['$scope', '$rootScope', '$routeParams', '$location', 'Global', 'Block', 'Blocks', function ($scope, $rootScope, $routeParams, $location, Global, Block, Blocks) {
|
angular.module('insight.blocks').controller('BlocksController',
|
||||||
|
function ($scope, $rootScope, $routeParams, $location, Global, Block, Blocks) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.list = function() {
|
$scope.list = function() {
|
||||||
|
@ -32,4 +33,4 @@ angular.module('insight.blocks').controller('BlocksController', ['$scope', '$roo
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.params = $routeParams;
|
$scope.params = $routeParams;
|
||||||
}]);
|
});
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.system').controller('FooterController',
|
angular.module('insight.system').controller('FooterController',
|
||||||
['$scope',
|
function ($scope, Global, Status) {
|
||||||
'Global',
|
|
||||||
'Status',
|
|
||||||
function ($scope, Global, Status) {
|
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.getFooter = function() {
|
$scope.getFooter = function() {
|
||||||
|
@ -15,5 +12,5 @@ angular.module('insight.system').controller('FooterController',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
}]);
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.system').controller('HeaderController', ['$scope', 'Global', function ($scope, Global) {
|
angular.module('insight.system').controller('HeaderController',
|
||||||
|
function ($scope, Global) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.menu = [
|
$scope.menu = [
|
||||||
|
@ -15,4 +16,4 @@ angular.module('insight.system').controller('HeaderController', ['$scope', 'Glob
|
||||||
];
|
];
|
||||||
|
|
||||||
$scope.isCollapsed = false;
|
$scope.isCollapsed = false;
|
||||||
}]);
|
});
|
||||||
|
|
|
@ -3,13 +3,7 @@
|
||||||
var TRANSACTION_DISPLAYED = 5;
|
var TRANSACTION_DISPLAYED = 5;
|
||||||
var BLOCKS_DISPLAYED = 5;
|
var BLOCKS_DISPLAYED = 5;
|
||||||
angular.module('insight.system').controller('IndexController',
|
angular.module('insight.system').controller('IndexController',
|
||||||
['$scope',
|
function($scope, $rootScope, Global, get_socket, Blocks, Transactions) {
|
||||||
'$rootScope',
|
|
||||||
'Global',
|
|
||||||
'get_socket',
|
|
||||||
'Blocks',
|
|
||||||
'Transactions',
|
|
||||||
function($scope, $rootScope, Global, get_socket, Blocks, Transactions) {
|
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
var socket = get_socket($scope);
|
var socket = get_socket($scope);
|
||||||
|
@ -55,4 +49,4 @@ angular.module('insight.system').controller('IndexController',
|
||||||
|
|
||||||
$scope.txs = [];
|
$scope.txs = [];
|
||||||
$scope.blocks = [];
|
$scope.blocks = [];
|
||||||
}]);
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.search').controller('SearchController', ['$scope', '$routeParams', '$location', 'Global', 'Block', 'Transaction', 'Address', function ($scope, $routeParams, $location, Global, Block, Transaction, Address) {
|
angular.module('insight.search').controller('SearchController',
|
||||||
|
function ($scope, $routeParams, $location, Global, Block, Transaction, Address) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.search = function() {
|
$scope.search = function() {
|
||||||
|
@ -31,4 +32,4 @@ angular.module('insight.search').controller('SearchController', ['$scope', '$rou
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
}]);
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.status').controller('StatusController', ['$scope', '$routeParams', '$location', '$rootScope', 'Global', 'Status', 'Sync', function ($scope, $routeParams, $location, $rootScope, Global, Status, Sync) {
|
angular.module('insight.status').controller('StatusController',
|
||||||
|
function ($scope, $routeParams, $location, $rootScope, Global, Status, Sync) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.getStatus = function(q) {
|
$scope.getStatus = function(q) {
|
||||||
|
@ -27,5 +28,5 @@ angular.module('insight.status').controller('StatusController', ['$scope', '$rou
|
||||||
$rootScope.syncError = 'Could not get sync information' + e;
|
$rootScope.syncError = 'Could not get sync information' + e;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}]);
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.transactions').controller('transactionsController',
|
angular.module('insight.transactions').controller('transactionsController',
|
||||||
['$scope',
|
function ($scope, $rootScope, $routeParams, $location, Global, Transaction, TransactionsByBlock, TransactionsByAddress, get_socket) {
|
||||||
'$rootScope',
|
|
||||||
'$routeParams',
|
|
||||||
'$location',
|
|
||||||
'Global',
|
|
||||||
'Transaction',
|
|
||||||
'TransactionsByBlock',
|
|
||||||
'TransactionsByAddress',
|
|
||||||
'get_socket',
|
|
||||||
function ($scope, $rootScope, $routeParams, $location, Global, Transaction, TransactionsByBlock, TransactionsByAddress, get_socket) {
|
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.findThis = function() {
|
$scope.findThis = function() {
|
||||||
|
@ -62,4 +53,4 @@ angular.module('insight.transactions').controller('transactionsController',
|
||||||
|
|
||||||
$scope.txs = [];
|
$scope.txs = [];
|
||||||
|
|
||||||
}]);
|
});
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.address').factory('Address', ['$resource', function($resource) {
|
angular.module('insight.address').factory('Address',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/addr/:addrStr', {
|
return $resource('/api/addr/:addrStr', {
|
||||||
addrStr: '@addStr'
|
addrStr: '@addStr'
|
||||||
}, {
|
}, {
|
||||||
|
@ -18,5 +19,5 @@ angular.module('insight.address').factory('Address', ['$resource', function($res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}]);
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.blocks').factory('Block', ['$resource', function($resource) {
|
angular.module('insight.blocks').factory('Block',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/block/:blockHash', {
|
return $resource('/api/block/:blockHash', {
|
||||||
blockHash: '@blockHash'
|
blockHash: '@blockHash'
|
||||||
}, {
|
}, {
|
||||||
|
@ -18,8 +19,9 @@ angular.module('insight.blocks').factory('Block', ['$resource', function($resour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}]);
|
});
|
||||||
|
|
||||||
angular.module('insight.blocks').factory('Blocks', ['$resource', function($resource) {
|
angular.module('insight.blocks').factory('Blocks',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/blocks');
|
return $resource('/api/blocks');
|
||||||
}]);
|
});
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
//Global service for global variables
|
//Global service for global variables
|
||||||
angular.module('insight.system').factory('Global', [function() {}]);
|
angular.module('insight.system').factory('Global',
|
||||||
|
function() {
|
||||||
|
});
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,8 @@ ScopedSocket.prototype.emit = function(event, data, callback) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
angular.module('insight.socket').factory('get_socket', ['$rootScope', function($rootScope) {
|
angular.module('insight.socket').factory('get_socket',
|
||||||
|
function($rootScope) {
|
||||||
var socket = io.connect();
|
var socket = io.connect();
|
||||||
return function(scope) {
|
return function(scope) {
|
||||||
var scopedSocket = new ScopedSocket(socket, $rootScope);
|
var scopedSocket = new ScopedSocket(socket, $rootScope);
|
||||||
|
@ -55,5 +56,5 @@ angular.module('insight.socket').factory('get_socket', ['$rootScope', function($
|
||||||
});
|
});
|
||||||
return scopedSocket;
|
return scopedSocket;
|
||||||
};
|
};
|
||||||
}]);
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.status').factory('Status', ['$resource', function($resource) {
|
angular.module('insight.status').factory('Status',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/status', {
|
return $resource('/api/status', {
|
||||||
q: '@q'
|
q: '@q'
|
||||||
});
|
});
|
||||||
}]);
|
});
|
||||||
|
|
||||||
angular.module('insight.status').factory('Sync', ['$resource', function($resource) {
|
angular.module('insight.status').factory('Sync',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/sync');
|
return $resource('/api/sync');
|
||||||
}]);
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.transactions').factory('Transaction', ['$resource', function($resource) {
|
angular.module('insight.transactions').factory('Transaction',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/tx/:txId', {
|
return $resource('/api/tx/:txId', {
|
||||||
txId: '@txId'
|
txId: '@txId'
|
||||||
}, {
|
}, {
|
||||||
|
@ -18,20 +19,23 @@ angular.module('insight.transactions').factory('Transaction', ['$resource', func
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}]);
|
});
|
||||||
|
|
||||||
angular.module('insight.transactions').factory('TransactionsByBlock', ['$resource', function($resource) {
|
angular.module('insight.transactions').factory('TransactionsByBlock',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/txs', {
|
return $resource('/api/txs', {
|
||||||
block: '@block'
|
block: '@block'
|
||||||
});
|
});
|
||||||
}]);
|
});
|
||||||
|
|
||||||
angular.module('insight.transactions').factory('TransactionsByAddress', ['$resource', function($resource) {
|
angular.module('insight.transactions').factory('TransactionsByAddress',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/txs', {
|
return $resource('/api/txs', {
|
||||||
address: '@address'
|
address: '@address'
|
||||||
});
|
});
|
||||||
}]);
|
});
|
||||||
|
|
||||||
angular.module('insight.transactions').factory('Transactions', ['$resource', function($resource) {
|
angular.module('insight.transactions').factory('Transactions',
|
||||||
|
function($resource) {
|
||||||
return $resource('/api/txs');
|
return $resource('/api/txs');
|
||||||
}]);
|
});
|
||||||
|
|
Loading…
Reference in New Issue