json - Server polling Angular js and get difference between the response -


i have api getdata method returns json data every minute in angularjs.

function($scope, $http,$timeout, confirm) {    (function tick() {      $http.get('myapi.json').success(function(data) {          $scope.operation =  data ;              $timeout(tick, 60000);           })     })(); 

json data looks this. [{ "requests" :"200"} ....] after every minute "requests" value changes. want find difference between previous request value , current request value. tried $scope.$watch doesn't give object value change. please let me know how solve this?


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -