download.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. var myApp = angular.module('myApp');
  2. myApp.controller('DownloadController', ['$scope', '$http', '$location', '$routeParams', function($scope, $http, $location, $routeParams){
  3. console.log('DownloadController loaded...');
  4. $scope.loading = false;
  5. $scope.getDownloadInfo = function(){
  6. angular.element('*[id^="tviz"]').remove();
  7. var id = $routeParams.id;
  8. $scope.loading = true;
  9. $http.get('/crawler/getDownloadInfo/'+id).then(function(response){
  10. $scope.app = response.data;
  11. $scope.loading = false;
  12. });
  13. }
  14. $scope.getReviews = function(){
  15. var id = $routeParams.id;
  16. $scope.loading = true;
  17. $http.get('/crawler/getReviews/'+id).then(function(response){
  18. $scope.app = response.data;
  19. $scope.loading = false;
  20. }).catch(function() {
  21. $scope.getDownloadInfo();
  22. });
  23. }
  24. $scope.getPermissions = function(){
  25. var id = $routeParams.id;
  26. $scope.loading = true;
  27. $http.get('/crawler/getPermissions/'+id).then(function(response){
  28. $scope.app = response.data;
  29. $scope.loading = false;
  30. });
  31. }
  32. $scope.getAppicaptorResult = function(){
  33. var id = $routeParams.id;
  34. $scope.loading = true;
  35. $http.get('/crawler/getAppicaptorResult/'+id).then(function(response){
  36. $scope.app = response.data;
  37. $scope.loading = false;
  38. });
  39. }
  40. }]);