Closed tilleps closed 10 years ago
next
is populated only if there is another route which match the current url. In documentation it's suggested to check it
if( next instanceof Function)
next();
Anyway I understand this is not the behavior everyone want (including me) because in this way it's not possible to fire errors in a last-matching route. There is a branch called feature/next_always
in which the behaviour is to have next
always present. The code is already working and well documented in the branch but I'll merge it in 1.0 version because this breaks any existing code. You're are free to use that branch and to contribute to it.
Anyway I consider this bug as closed for the master
branch
The
next
variable for.addRoute()
is null. Appears to be okay in.before()
Example code:
After reading the documentation, it seems that
next()
is only available inaddRoute()
if there is another matching route after it. Would be nice to be able to next() to one of theerrors()