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