I have two components: AppComp and SimulationComp
AppComp contains one function :
generateEmptyPromise() {
return Promise.resolved('')
}
and has the following html :
<simulation-comp (simu)='generateEmptyPromise()'></simulation-comp>
Simulation comp handles the (simu) like this :
@Output() simu = new EventEmitter()
private eventHandled: boolean = false
// Triggered when a button of the component is pressed
whenClicked() {
this.simu.subscribe(() => {
this.eventHandled= true
})
this.simu.emit()
}
What I would like is eventHandled to become true based on the promise given by generateEmptyPromise (so after that the emit has been handled). However, it's not working atm, how could I adapt my code to have this behavior ? Maybe it is not supposed to work like this, and I am getting it completly wrong here.