europe.controller.js 733 B

123456789101112131415161718192021222324252627
  1. (function(){
  2. 'use strict'
  3. app.controller('Europe', [ '$scope', '$location', function($scope, $location){
  4. $scope.style = {
  5. dasharray: 0,
  6. // dashoffset: 0
  7. fill: 'white',
  8. }
  9. setInterval(function(){
  10. if($scope.style.dasharray < 3000){
  11. $scope.style.dasharray += 50;
  12. }else {
  13. $scope.style.fill = 'white';
  14. }
  15. // $scope.style.dashoffset -= 0;
  16. $scope.$apply();
  17. return $scope.style;
  18. }, 100)
  19. $scope.showCountry = function(country){
  20. var x = String(country)
  21. $location.path($location.path() + '/' + x)
  22. }
  23. }])
  24. })()