I have a task that needs to be completed as outlined below:
$rootscope.$on('function', var1, var2, var3){
var renderObejcts = $('.launch').fullGrid({
events: function(zone1, zone2, callback)
{
//performing an $http.get call for events type 1
events = $http.get().then(
....
callback(events);
)
},
//in this section, I require an appending kind of assignment to events of type2.
});
}
The script responsible for rendering the events is designed to expect values under events. It becomes quite cumbersome if I use a separate variable like event2 instead. I simply want event type2 to be appended to the existing events. If I make the second http call within the success block above, it will be asynchronous and the events won't render properly. Using async and await functions does not solve this issue. Any assistance on this matter is greatly appreciated.