Skip to content

Instantly share code, notes, and snippets.

@leandromoreira
Created August 5, 2013 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leandromoreira/6158345 to your computer and use it in GitHub Desktop.
Save leandromoreira/6158345 to your computer and use it in GitHub Desktop.
angular.module('Sauron')
.factory('TargetBitrates', ["$http", "$timeout", "Config", function($http, $timeout, Config){
var data = {list: []};
var onSuccess = function(result){
data.list = result.data.data;
$timeout(poller, Config.pollingTimeout);
};
var poller = function() {
$http.get('/streams.json', Config.httpOptions).then(onSuccess);
};
poller();
return {all: data};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment