Created
March 21, 2014 21:48
-
-
Save jjvdangelo/9697187 to your computer and use it in GitHub Desktop.
Trying to figure out why three $http.gets are fired at a time with this controller.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod.controller("MyController", | |
[ | |
"$scope", "$http", | |
($scope: any, $http: ng.IHttpService) => { | |
var queueChecker = setInterval(() => { | |
var url = "/foo/count"; | |
$http.get(url, { params: { cacheBuster: new Date().getMilliseconds() } }) | |
.success((data: any) => { | |
$scope.QueueView = data; | |
$scope.QueueView.lastUpdated = new Date(); | |
}); | |
}, 2500); | |
$scope.$on("$destroy", () => { clearInterval(queueChecker); }); | |
} | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment