I managed to get a constant poll of the backend functionality using this answer.
But at each timeout, the user interface flickers (empty model for a short time). How can I update the model (and view, respectively) after new data has appeared to avoid this flickering effect?
Here is my current controller (slightly modified from step_11 (Angular.js Tutorial) ):
function MyPollingCtrl($scope, $routeParams, $timeout, Model) { (function tick() { $scope.line = Model.get({ modelId : $routeParams.modelId }, function(model) { $timeout(tick, 2000); }); })(); }
// edit: I am using the current stable version 1.0.6 from Angular.js
source share