Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Refresh referenced lists in ng-admin

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.

like image 870
Muhamed Abayed Avatar asked Jul 05 '16 09:07

Muhamed Abayed


1 Answers

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.

like image 95
Vadiem Janssens Avatar answered Sep 23 '22 00:09

Vadiem Janssens