I've got an array of angularjs $http
config objects:
var steps= [
{url:"http://api.com/test1", method: "GET"},
{url:"http://api.com/test2",method: "POST"},
{url:"http://api.com/test3",method: "GET"},
]
These are all API calls I need to execute in sequence. The number of this calls can vary.
I would like transform each of this object in a function executing the $http
call (so then I can use that with map
to obtain an array of functions).
Something like:
function transform(conf){
return $http(conf);
}
But this, obviously, executes the $http
call.