Link to home
Start Free TrialLog in
Avatar of maccaj51
maccaj51Flag for Afghanistan

asked on

How do I refresh ajax data from controller using angular?

Hi Experts,

I have the following code which gets data from my api and works great.

    var app = angular.module('2moro', []);
    app.controller('results', function($scope, $http) {
      $http.get('/api/snow.php').then(function (response) { 
	    $scope.results = response.data.results; 
      });
    });

Open in new window


How would I then refresh the data using setInterval or such a like?

Thanks for any help
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maccaj51

ASKER

Thanks so much. Worked Great
You are welcome.