Closed codermak closed 2 years ago
Hi, Is there a way to find if there are no matching routes for current url. So that a invalid url message can be shown on the page.
eg. We have 2 routes configured crossroads.addRoute('#home', function () { console.log('home page') }) crossroads.addRoute('#page1', function () { console.log('page 1 page') })
Now if someone opens #unmatched instead of #home or #page1. Another function gets called
Something similar to this
crossroads.unmatchedRoute( function () { console.log('Unmatched page') })
https://millermedeiros.github.io/crossroads.js/#crossroads-bypassed
I found the solution here. Closing the question.
Hi, Is there a way to find if there are no matching routes for current url. So that a invalid url message can be shown on the page.
eg. We have 2 routes configured crossroads.addRoute('#home', function () { console.log('home page') }) crossroads.addRoute('#page1', function () { console.log('page 1 page') })
Now if someone opens #unmatched instead of #home or #page1. Another function gets called
Something similar to this
crossroads.unmatchedRoute( function () { console.log('Unmatched page') })