ish.router(options)
Description:
An application router.
Returns
$.router
The router instance
Parameters:
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| options |
|
The utilities options object. Properties
|
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)
Description:
Add a route to the router instance.
Parameters:
| Name | Type | Description |
|---|---|---|
| route |
|
The route path you're adding. |
| fn |
|
The routing object conatining 'enter' and 'leave' functions keyed by their respective name. |