diff --git a/public/app/app.js b/public/app/app.js index 064ae6d..4c0eaf6 100644 --- a/public/app/app.js +++ b/public/app/app.js @@ -24,7 +24,6 @@ angular.module('ffhb', [ }; amMoment.changeLocale('de'); $rootScope.globals = $cookieStore.get('globals') || {}; - $rootScope.autorefresh = config.refresh; if ($rootScope.globals.currentUser) { $http.defaults.headers.common['Authorization'] = 'Basic ' + $rootScope.globals.currentUser.authdata; // jshint ignore:line } diff --git a/public/components/store.js b/public/components/store.js index e5548bf..4a620d4 100644 --- a/public/components/store.js +++ b/public/components/store.js @@ -142,7 +142,7 @@ angular.module('ffhb') }; myservice.autorefresh = function(time){ if(autorefresher !== undefined){ - autorefresher.cancel(); + $interval.cancel(autorefresher); } if(time){ autorefresher = $interval(function () { @@ -150,7 +150,8 @@ angular.module('ffhb') }, time); } }; - + $rootScope.autorefresh = config.refresh; + myservice.autorefresh($rootScope.autorefresh); return myservice; });