I’m a beginner so bear with me if this is a silly question.
I have a VM ‘foo’ with canDeactivate implementation that is hardcoded to return false. In another VM called ‘bar’ I call navigateToRoute('baz'), and the behavior is as expected: the displayed view is still ‘foo’. But in the scope of ‘bar’ I don’t know what actually has happened.
When calling the navigateToRoute('baz'), how do I know if the navigation did not succeed?
I see, that’s interesting. I’m using TypeScript, and the editor tells me that navigateToRoute returns a boolean. Now that I tried it with an await I can see that this is an object that looks like the following in case of successful navigation:
I’ve replaced NOPE with ${navigationFailed.completed} in your gist to confirm that.
So I could make it work, but obviously my VS Code is not happy that I’m checking for nav.completed === true given that it thinks that nav is a boolean. Probably I need to update something…
Anyway, the root problem is resolved, thank you for your help!
hmm you’re right about the definition, I don’t know if the docs/typings just need updated? You might be able to extend the interface to replace it but that seems a bit wrong in the long term.