Created
August 5, 2013 18:47
-
-
Save leandromoreira/6158345 to your computer and use it in GitHub Desktop.
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
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