flocore-node/public/js/controllers/address.js
Manuel Araoz b7d3666249 Merge branch 'master' of github.com:bitpay/insight into feature/address-socket-api
Conflicts:
	app/controllers/socket.js
	app/models/Transaction.js
	lib/PeerSync.js
	public/js/controllers/address.js
	public/js/controllers/index.js
	public/js/controllers/transactions.js
	public/views/transaction.html
2014-01-20 11:47:22 -03:00

30 lines
727 B
JavaScript

'use strict';
angular.module('insight.address').controller('AddressController',
['$scope',
'$rootScope',
'$routeParams',
'$location',
'Global',
'Address',
'socket',
function ($scope, $rootScope, $routeParams, $location, Global, Address, socket) {
$scope.global = Global;
$scope.findOne = function() {
Address.get({
addrStr: $routeParams.addrStr
}, function(address) {
$scope.address = address;
}, function() {
$rootScope.flashMessage = 'Address Not Found';
$location.path('/');
});
};
socket.on('connect', function() {
socket.emit('subscribe', $routeParams.addrStr);
});
$scope.params = $routeParams;
}]);