Utilizing the rxjs library in a component, I came across something called uiSignal within it. My goal is to use this to show a 'loading' screen while making subscription calls. It works well for simple calls, but when there are nested subscriptions, it fails to wait for the nested call to finish.
For instance:
this.Service.DoSomething(this.thing)
.uiSignal({ uiLabel: 'Loading', debugInfo: '' }).subscribe(thing => {
this.nestedMethod();
}
nestedMethod() {
this.Service.DoSomethingElse(this.OtherThing).subscribe(otherThing => {
// Do Something Else
}
}
The loading screen only appears during the 'DoSomething' subscription and disappears before the completion of the DoSomethingElse subscription. I attempted adding the uiSignal on the 'DoSomethingElse' subscription in the nestedMethod as well, but it did not work.
Essentially, I want the loading screen to stay visible until the nested method has finished executing.