Return Observable in canDeactivate not working
Use take(1)
or first()
(don't forget to import)
return this.formService.getModalSelectionObservable().first();
to ensure the observable is closed after the first event, otherwise the router will wait until it is closed from the service.