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;
});
/hello-router/
//
Package Sidebar
Install
Weekly Downloads