I'm trying to call a function from a variable containing it's name.
More precisely, my idea is to have a timed "master" function, which will call a set of functions every n seconds.
The set of functions to call would be defined in an array, populated by names based on the called page.
Found this in jquery: Calling a Jquery function from variable value but no luck.
Any suggestions on how to achieve this?
Thnx.
EDTI
Here's a stub of code i'm working on:
var exec = "updateClock";
var updateClock = function () {
//something nice here :)
};
var timer = setInterval(function () {
$scope.$apply([exec]);
}, 15000);
someObject[exec].call().