remove old style angular module def

This commit is contained in:
Manuel Araoz 2014-01-20 18:09:18 -03:00
parent e3ccb18b57
commit e45c1ef2bd
14 changed files with 52 additions and 61 deletions

View File

@ -1,13 +1,6 @@
'use strict';
angular.module('insight.address').controller('AddressController',
['$scope',
'$rootScope',
'$routeParams',
'$location',
'Global',
'Address',
'get_socket',
function ($scope, $rootScope, $routeParams, $location, Global, Address, get_socket) {
$scope.global = Global;
@ -33,4 +26,4 @@ angular.module('insight.address').controller('AddressController',
socket.emit('subscribe', $routeParams.addrStr);
$scope.params = $routeParams;
}]);
});

View File

@ -1,6 +1,7 @@
'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.list = function() {
@ -32,4 +33,4 @@ angular.module('insight.blocks').controller('BlocksController', ['$scope', '$roo
};
$scope.params = $routeParams;
}]);
});

View File

@ -1,10 +1,7 @@
'use strict';
angular.module('insight.system').controller('FooterController',
['$scope',
'Global',
'Status',
function ($scope, Global, Status) {
function ($scope, Global, Status) {
$scope.global = Global;
$scope.getFooter = function() {
@ -15,5 +12,5 @@ angular.module('insight.system').controller('FooterController',
});
};
}]);
});

View File

@ -1,6 +1,7 @@
'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.menu = [
@ -15,4 +16,4 @@ angular.module('insight.system').controller('HeaderController', ['$scope', 'Glob
];
$scope.isCollapsed = false;
}]);
});

View File

@ -3,13 +3,7 @@
var TRANSACTION_DISPLAYED = 5;
var BLOCKS_DISPLAYED = 5;
angular.module('insight.system').controller('IndexController',
['$scope',
'$rootScope',
'Global',
'get_socket',
'Blocks',
'Transactions',
function($scope, $rootScope, Global, get_socket, Blocks, Transactions) {
function($scope, $rootScope, Global, get_socket, Blocks, Transactions) {
$scope.global = Global;
var socket = get_socket($scope);
@ -55,4 +49,4 @@ angular.module('insight.system').controller('IndexController',
$scope.txs = [];
$scope.blocks = [];
}]);
});

View File

@ -1,6 +1,7 @@
'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.search = function() {
@ -31,4 +32,4 @@ angular.module('insight.search').controller('SearchController', ['$scope', '$rou
});
};
}]);
});

View File

@ -1,6 +1,7 @@
'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.getStatus = function(q) {
@ -27,5 +28,5 @@ angular.module('insight.status').controller('StatusController', ['$scope', '$rou
$rootScope.syncError = 'Could not get sync information' + e;
});
};
}]);
});

View File

@ -1,16 +1,7 @@
'use strict';
angular.module('insight.transactions').controller('transactionsController',
['$scope',
'$rootScope',
'$routeParams',
'$location',
'Global',
'Transaction',
'TransactionsByBlock',
'TransactionsByAddress',
'get_socket',
function ($scope, $rootScope, $routeParams, $location, Global, Transaction, TransactionsByBlock, TransactionsByAddress, get_socket) {
function ($scope, $rootScope, $routeParams, $location, Global, Transaction, TransactionsByBlock, TransactionsByAddress, get_socket) {
$scope.global = Global;
$scope.findThis = function() {
@ -62,4 +53,4 @@ angular.module('insight.transactions').controller('transactionsController',
$scope.txs = [];
}]);
});

View File

@ -1,6 +1,7 @@
'use strict';
angular.module('insight.address').factory('Address', ['$resource', function($resource) {
angular.module('insight.address').factory('Address',
function($resource) {
return $resource('/api/addr/:addrStr', {
addrStr: '@addStr'
}, {
@ -18,5 +19,5 @@ angular.module('insight.address').factory('Address', ['$resource', function($res
}
}
});
}]);
});

View File

@ -1,6 +1,7 @@
'use strict';
angular.module('insight.blocks').factory('Block', ['$resource', function($resource) {
angular.module('insight.blocks').factory('Block',
function($resource) {
return $resource('/api/block/: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');
}]);
});

View File

@ -1,5 +1,7 @@
'use strict';
//Global service for global variables
angular.module('insight.system').factory('Global', [function() {}]);
angular.module('insight.system').factory('Global',
function() {
});

View File

@ -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();
return function(scope) {
var scopedSocket = new ScopedSocket(socket, $rootScope);
@ -55,5 +56,5 @@ angular.module('insight.socket').factory('get_socket', ['$rootScope', function($
});
return scopedSocket;
};
}]);
});

View File

@ -1,12 +1,14 @@
'use strict';
angular.module('insight.status').factory('Status', ['$resource', function($resource) {
angular.module('insight.status').factory('Status',
function($resource) {
return $resource('/api/status', {
q: '@q'
});
}]);
});
angular.module('insight.status').factory('Sync', ['$resource', function($resource) {
angular.module('insight.status').factory('Sync',
function($resource) {
return $resource('/api/sync');
}]);
});

View File

@ -1,6 +1,7 @@
'use strict';
angular.module('insight.transactions').factory('Transaction', ['$resource', function($resource) {
angular.module('insight.transactions').factory('Transaction',
function($resource) {
return $resource('/api/tx/: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', {
block: '@block'
});
}]);
});
angular.module('insight.transactions').factory('TransactionsByAddress', ['$resource', function($resource) {
angular.module('insight.transactions').factory('TransactionsByAddress',
function($resource) {
return $resource('/api/txs', {
address: '@address'
});
}]);
});
angular.module('insight.transactions').factory('Transactions', ['$resource', function($resource) {
angular.module('insight.transactions').factory('Transactions',
function($resource) {
return $resource('/api/txs');
}]);
});