The router factory

ish.router(options)

Description:

An application router.

Returns
$.router

The router instance

Parameters:
Name Type Description
options Object

The utilities options object.

Properties
Name Type Description
baseURL String

The base URL of the application.

routes Object

The routing object.

Example:
var router = ish.router({ 
		baseURL: 'http://ish.stateful.local',
		routes: {
			notFound: function(url){
			},
			before: function(history){
			
			},
			after: function(history){
			
			},
			'/':  {
				enter: function(slugs, history){

				},
				leave: function(slugs, history){
				}
			}
		}
};

Extends

Methods

add(route, fn)

line 168
Description:

Add a route to the router instance.

Returns
ish.router

Chainable, returns its own instance.

Parameters:
Name Type Description
route String

The route path you're adding.

fn Object

The routing object conatining 'enter' and 'leave' functions keyed by their respective name.