search by height of block
This commit is contained in:
parent
56dc130b4f
commit
ef109e3251
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.search').controller('SearchController',
|
angular.module('insight.search').controller('SearchController',
|
||||||
function ($scope, $routeParams, $location, $timeout, Global, Block, Transaction, Address) {
|
function ($scope, $routeParams, $location, $timeout, Global, Block, Transaction, Address, BlockByHeight) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.search = function() {
|
$scope.search = function() {
|
||||||
|
@ -10,6 +10,11 @@ angular.module('insight.search').controller('SearchController',
|
||||||
$scope.badQuery = false;
|
$scope.badQuery = false;
|
||||||
$scope.q = '';
|
$scope.q = '';
|
||||||
|
|
||||||
|
BlockByHeight.get({
|
||||||
|
blockHeight: q
|
||||||
|
}, function(hash) {
|
||||||
|
$location.path('/block/' + hash.blockHash);
|
||||||
|
}, function() { // block by height not found
|
||||||
Block.get({
|
Block.get({
|
||||||
blockHash: q
|
blockHash: q
|
||||||
}, function() {
|
}, function() {
|
||||||
|
@ -33,6 +38,7 @@ angular.module('insight.search').controller('SearchController',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue