From e1b5f63d73113f89a902ad66c7373a8584465209 Mon Sep 17 00:00:00 2001 From: Andy Buecker Date: Thu, 30 Oct 2014 11:24:26 -0700 Subject: [PATCH] fix(protractor): Replace $timeout with $interval --- app/scripts/services/access-token.js | 6 +++--- dist/oauth-ng.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/scripts/services/access-token.js b/app/scripts/services/access-token.js index 686de0a..b6ffc7e 100644 --- a/app/scripts/services/access-token.js +++ b/app/scripts/services/access-token.js @@ -2,7 +2,7 @@ var accessTokenService = angular.module('oauth.accessToken', ['ngStorage']); -accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $timeout){ +accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $interval){ var service = { token: null @@ -144,9 +144,9 @@ accessTokenService.factory('AccessToken', function($rootScope, $location, $sessi var setExpiresAtEvent = function(){ var time = (new Date(service.token.expires_at))-(new Date()); if(time){ - $timeout(function(){ + $interval(function(){ $rootScope.$broadcast('oauth:expired', service.token) - }, time) + }, time, 1) } }; diff --git a/dist/oauth-ng.js b/dist/oauth-ng.js index 84f02c5..3182e8c 100644 --- a/dist/oauth-ng.js +++ b/dist/oauth-ng.js @@ -20,7 +20,7 @@ angular.module('oauth').config(['$locationProvider','$httpProvider', var accessTokenService = angular.module('oauth.accessToken', ['ngStorage']); -accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $timeout){ +accessTokenService.factory('AccessToken', function($rootScope, $location, $sessionStorage, $interval){ var service = { token: null @@ -162,9 +162,9 @@ accessTokenService.factory('AccessToken', function($rootScope, $location, $sessi var setExpiresAtEvent = function(){ var time = (new Date(service.token.expires_at))-(new Date()); if(time){ - $timeout(function(){ + $interval(function(){ $rootScope.$broadcast('oauth:expired', service.token) - }, time) + }, time, 1) } };