87
rated 0 times
[
90]
[
3]
/ answers: 1 / hits: 9185
/ 10 Years ago, fri, july 18, 2014, 12:00:00
I am trying to convert strings to AngularJS Service method calls in a controller. For example, I would like to convert the string Contact.send(email) to call an existing service method. I thought to use:
window[Contact][send](email);
as in this thread - How to execute a JavaScript function when I have its name as a string - but it says that the Contact service is undefined, despite being injected into the controller.
More From » angularjs