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.

47 lines
1.4 KiB

  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.ids = [];
  11. $http.get(clientapi + 'ids')
  12. .then(function(data) {
  13. console.log('data success');
  14. console.log(data);
  15. $scope.ids = data.data;
  16. }, function(data) {
  17. console.log('data error');
  18. });
  19. $scope.newID = function() {
  20. $http.get(clientapi + 'newid')
  21. .then(function(data) {
  22. console.log('data success');
  23. console.log(data);
  24. $scope.ids = data.data;
  25. }, function(data) {
  26. console.log('data error');
  27. });
  28. };
  29. $scope.blindAndVerify = function(pubK) {
  30. $http.get(clientapi + 'blindandverify/' + pubK)
  31. .then(function(data) {
  32. console.log('data success');
  33. console.log(data);
  34. $scope.ids = data.data;
  35. }, function(data) {
  36. console.log('data error');
  37. });
  38. };
  39. });