hello-router
1.0.0 • Public • Published hello-router
client-side router for SPA
Install
npm install hello-router
API
- .register(uri, action)
- .activate(uri)
- .dispatch(uri)
- .redirect(uri)
- .run()
Usage
var router = helloRouter;
router.register('/a', function () {
router.redirect('/b');
});
router.register('/b', function () {
router.dispatch('/404');
});
router.register('/404', function () {
});
router.run();
$('a').click(function () {
router.active(this.href);
return false;
});
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 1.0.0
1
Version History
- VersionDownloads (Last 7 Days)
- 1.0.0
1
Package Sidebar
Install
Weekly Downloads