The problem is simply to reload the authentication token at regular interval. I am using $interval service for that. the code is as follows
function refresh_session() {
console.log("testing");
}
module.exports = function ($scope,$rootScope,$localStorage,$location,$interval,$http) {
$interval(refresh_session,5000);
This works just fine, but i need to access variables inside $scope and $localStorage to update the token. I have tried both passing a function defined inside $scope to $interval service as well as passing parameters to external function. Both of them are not working. What is the correct way i can go about that using the angular method ?