Skip to content

Instantly share code, notes, and snippets.

@timrwood
Created December 18, 2012 21:30
Show Gist options
  • Save timrwood/4332199 to your computer and use it in GitHub Desktop.
Save timrwood/4332199 to your computer and use it in GitHub Desktop.
router.js
define([
"rosy/views/Router",
"mysite/views/Home",
"mysite/views/About",
"mysite/views/Contact"
],
function (Router, Home, About, Contact) {
var group = new Router({
id : "main",
selector : "#main",
useHistory : true,
transition : "async"
});
group.addRoute('/home', Home, {
bodyClass : "home",
title : "Home"
});
group.addRoute('/about', About, {
bodyClass : "about",
title : "About My Site"
});
group.addRoute('/contact', Contact, {
bodyClass : "contact",
title : "Contact Me"
});
group.addAlias('/', '/home');
return group;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment