Use ionRouteWillChange event?

I’m working in an app and routing suddenly broke, when I click on an item in a list, the routerLink is supposed to open a document, but suddenly its falling back to my default route and opening the app’s dashboard.

I’m looking for ways to troubleshoot the router, so I can see why my dashboard is opening instead of the page I expect. I noticed in the ion-router documentation that there’s a ionRouteWillChange event, but I can’t find any example showing how to listen for this event. I’m assuming it’s just an event fired by the router, but do I have to do anything special to listen for it? Can someone please show me an example?

Try adding prefix “on” (and lower the 1st char) to event name, like this:

<ion-router useHash={false} onIonRouteWillChange={data => console.log('ionRouteWillChange', data.detail)}>

@anonimusprogramus OK, yeah, that makes sense. I didn’t think of it that way, I was thinking of creating an event listener in my TypeScript code. Thanks for the response.