I assign two calls to the web service in two variables in referencesPromise
and contactTypesPromise
$onInit()
(I can create a new method for that, if needed)
$onInit() {
const referencesPromise = this.ReferenceService.getMultipleReferences(this.AgentReferences)
const contactTypesPromise = this.ContactService.getContactTypes()
Promise.all([referencesPromise, contactTypesPromise]).then((responses) => {
this.references = responses[0]
this.contactTypes = responses[1]
const stateParams = this.$state.params
return this.setContactSteps()
})
}
What is his alternative with async-await?