Is it possible to define a catch-all route or an error route in Sammy.js? I know I can bind to 'error' but if no route matches that does not seem to be triggered.
Thanks!
You should override the notFound
function.
Like this:
var app = $.sammy('#app', function() {
this.notFound = function(){
// do something
}
});
This is recommended by the author of Sammy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With