I have a duo of components: AppComp
and SimulationComp
AppComp
consists of a single function :
createEmptyPromise() {
return Promise.resolved('')
}
and it showcases the following html structure :
<simulation-comp (simu)='createEmptyPromise()'></simulation-comp>
The Simulation comp manages the (simu)
in this manner :
@Output() simu = new EventEmitter()
private eventHandled: boolean = false
// Activated upon pressing a button within the component
whenClicked() {
this.simu.subscribe(() => {
this.eventHandled= true
})
this.simu.emit()
}
My desire is for eventHandled
to transition to true based on the promise delivered by generateEmptyPromise
(after handling the emit). However, the current setup isn't achieving that. How can I modify my code to achieve this behavior? Perhaps my approach is incorrect altogether.