route icon indicating copy to clipboard operation
route copied to clipboard

Feature Request: Add method to Router to manage unhandled routes

Open NathanielAJohnson opened this issue 12 years ago • 3 comments

Routing systems often provide a method that specifies what to do in the event that the route does not match any known route. In Angular this is done with an otherwise method in the $routeProvider service. http://docs.angularjs.org/api/ngRoute.$routeProvider

This is convenient for debugging but also useful to correct user bookmark context errors that crop up when resources are identified with user specific data or context based ids.

NathanielAJohnson avatar Nov 12 '13 14:11 NathanielAJohnson

Would defaultStream help you?

 ..serve(..., handler)
 ..defaultStream.listen(staticFiles.serveRequest);

sethladd avatar Nov 12 '13 14:11 sethladd

Unfortunately defaultStream is server side only. There is no equivalent for client side routing.

butlermatt avatar Nov 12 '13 14:11 butlermatt

I noticed that the route-hierarchy and 0.5.0 adds this functionality. Knowing that this is tip of the trunk, can I reasonably expect 0.5.0 to contain most of this functionality?

NathanielAJohnson avatar Nov 12 '13 14:11 NathanielAJohnson