Closed caihuattkl closed 6 years ago
I want to get the last route that can't be realized?
Do you mean you want to execute a function when no route matches the current URL?
Yes, it's one of the needs。
So you can use the error handler for the 404 case
router
.errors(404, function( err, href){
alert('Page not found!' + href );
});
this will match any unmatching route and you have access to href in the handler
Thank you. It's beginning to understand.
Great!
Can the routing module have some hooks to get the last route of the current routing?