UMD Router
A simple to use router that places nicely with AMD when you need it to.
Installation
Via Bower
$ bower install umdrouter
Via NPM
$ npm install umdrouter
Usage
First, create an instance of the router:
var router = ;
Once your router is instantiated you can build routes via the on()
method. This
method supports two formats:
Single Callback Route Handling
A single callback can be provided which will fire when the route is matched:
router;
Object-Event Route Handling
The router will process an object with at least one of the following:
router;
URL Parameters
The router watches for and matches routes with the :variable
convention, for example:
router;
These parameters function the same in the simple, callback method as well as the object-event structure.
Extending
The router is made to allow for extensibility independent of a specific route:
UMDRouter;
Or by extending inside the route itself:
router;