arnaucube
arnaucube/goBlockchainDataAnalysisPublic Self-hosted repository
goBlockchainDataAnalysis/web/views/address/address.js
web/views/address/address.jsRaw
 1'use strict';
 2
 3angular.module('app.address', ['ngRoute'])
 4
 5    .config(['$routeProvider', function($routeProvider) {
 6        $routeProvider.when('/address/:hash', {
 7            templateUrl: 'views/address/address.html',
 8            controller: 'AddressCtrl'
 9        });
10    }])
11
12    .controller('AddressCtrl', function($scope, $http, $routeParams) {
13        $scope.address = {};
14        $http.get(urlapi + 'address/' + $routeParams.hash)
15            .then(function(data, status, headers, config) {
16                console.log(data);
17                $scope.address = data.data;
18            }, function(data, status, headers, config) {
19                console.log('data error');
20            });
21            $scope.addresstimechart= {
22                data:[],
23                labels:  []
24            };
25            $http.get(urlapi + 'addresstimechart/' + $routeParams.hash)
26                .then(function(data, status, headers, config) {
27                    console.log(data);
28                    $scope.addresstimechart.data = data.data.data;
29                    $scope.addresstimechart.labels = data.data.labels;
30                }, function(data, status, headers, config) {
31                    console.log('data error');
32                });
33    });