fix autorefresh
This commit is contained in:
parent
ed6c96cbae
commit
ad88ed54d5
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue