added pagination on Blocks, Txs, Addresses

This commit is contained in:
arnaucode
2017-08-31 16:13:50 +02:00
parent 58393a26e9
commit 63a40a05b2
12 changed files with 148 additions and 38 deletions

View File

@@ -45,6 +45,11 @@
</tr>
</tbody>
</table>
<ul class="pager">
<li><a class="withripple" ng-click="getPrev()">Previous</a></li>
Current page: {{page}}
<li><a class="withripple" ng-click="getNext()">Next</a></li>
</ul>
</div>
</div>
</div>

View File

@@ -13,12 +13,25 @@ angular.module('app.txs', ['ngRoute'])
//last tx
$scope.txs = [];
$http.get(urlapi + 'lasttx')
.then(function(data, status, headers, config) {
console.log(data);
$scope.txs = data.data;
}, function(data, status, headers, config) {
console.log('data error');
});
$scope.page = 1;
$scope.count = 10;
$scope.getTxs = function() {
$http.get(urlapi + 'txs/' + $scope.page + '/' + $scope.count)
.then(function(data, status, headers, config) {
console.log(data);
$scope.txs = data.data;
}, function(data, status, headers, config) {
console.log('data error');
});
};
$scope.getTxs();
$scope.getPrev = function(){
$scope.page++;
$scope.getTxs();
};
$scope.getNext = function(){
$scope.page--;
$scope.getTxs();
};
});