Your problem is here;
.then(app.trigger('FireEvent', `dataObsArray`))
The way that will resolve is to call app.trigger
, get the result, and pass that as the next step in the chain to then()
, which is unlikely to be what you want. You need to wrap that in an anonymous function so that then()
can call it after the dataContext
call.
return (datacontext.getData("Test, testData))
.then(function(data) {
app.trigger('FireEvent', data?) //This depends on what getData returns
})
.fail(queryFailed);