So I implemented a canDeactivate function which expects an observable of type boolean to be returned. Condition to leave is async so I can't do something like this for example:
public canDeactivate(): Observable<boolean> {
setTimeout(() => {
return of(true);
}, 5000);
}
How can I make a request inside this function that will determine if I can leave or not?