6

I'm using ng-admin with a rest API, I have multiple referenced lists which are update frequently in the server side.

Is there a way to refresh referenced lists every 5 seconds or so using ng-admin?

EDIT: I already know about setInterval and $interval. But I can't figure out where in ng-admin I should put it, what file exactly, that's where I'm stuck.

1 Answers1

2

You could use the Angular $interval service. This is just a wrapper around the native interval javascript function.

$interval(function() {
    // fetch results
}, 5000);

This function will run every 5000 milliseconds (5 seconds).

More information about $interval can be found here.

Vadiem Janssens
  • 4,069
  • 1
  • 17
  • 27