arnaucube
arnaucube/goBlockchainDataAnalysisPublic Self-hosted repository
goBlockchainDataAnalysis/web/views/blocks/blocks.js
web/views/blocks/blocks.jsRaw
 1'use strict';
 2
 3angular.module('app.blocks', ['ngRoute'])
 4
 5    .config(['$routeProvider', function($routeProvider) {
 6        $routeProvider.when('/blocks', {
 7            templateUrl: 'views/blocks/blocks.html',
 8            controller: 'BlocksCtrl'
 9        });
10    }])
11
12    .controller('BlocksCtrl', function($scope, $http) {
13
14        //last tx
15        $scope.txs = [];
16        $http.get(urlapi + 'lasttx')
17            .then(function(data, status, headers, config) {
18                console.log(data);
19                $scope.txs = data.data;
20            }, function(data, status, headers, config) {
21                console.log('data error');
22            });
23
24    });