Source Code:
(back to article)
Submit
Result:
Report an issue
angular.module('myModule') .service('DataManager', function($interval, $http, Person, $rootScope) { $interval(function(){ $http.get([url]) .then(function(data){ Person.setName(data.name); Person.setListCount(data.count); // here we have to send signal that we have a new live data from the server // we use Root Scope, because we don't know what scope architecture do we have $rootScope.$broadcast("newPersonData"); }); // erhalten von Daten alle 1 Minute }, 60000); })