(function(){ 'use strict' app.controller('GlobalMap', [ '$scope', '$location', function($scope, $location){ $scope.style = { dasharray: 0, // dashoffset: 0 fill: 'none', stroke: 'black', } setInterval(function(){ if($scope.style.dasharray < 2800){ $scope.style.dasharray += 50; }else { $scope.style.fill = 'white'; } // $scope.style.dashoffset -= 0; $scope.$apply(); return $scope.style; }, 100) $scope.showEurop = function(){ $location.path($location.url() + '/europe'); } }]) })()