You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1018 B

  1. 'use strict';
  2. angular.module('app.main', ['ngRoute'])
  3. .config(['$routeProvider', function($routeProvider) {
  4. $routeProvider.when('/main', {
  5. templateUrl: 'views/main/main.html',
  6. controller: 'MainCtrl'
  7. });
  8. }])
  9. .controller('MainCtrl', function($scope, $http) {
  10. $scope.peerslist = {};
  11. $http.get(urlapi + 'peers')
  12. .then(function(data, status, headers, config) {
  13. console.log('data success');
  14. console.log(data.data);
  15. $scope.peerslist = data.data;
  16. }, function(data, status, headers, config) {
  17. console.log('data error');
  18. });
  19. $scope.blockchain={};
  20. $http.get(urlapi + 'blockchain')
  21. .then(function(data, status, headers, config) {
  22. console.log('data success');
  23. console.log(data.data);
  24. $scope.blockchain = data.data;
  25. }, function(data, status, headers, config) {
  26. console.log('data error');
  27. });
  28. });