Skip to content

Instantly share code, notes, and snippets.

@hojberg
Created November 6, 2014 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hojberg/20146c26dfdd4137ba98 to your computer and use it in GitHub Desktop.
Save hojberg/20146c26dfdd4137ba98 to your computer and use it in GitHub Desktop.
aviator example
var DocumentRouteTarget = {
show: function () {
// this function is called for /documents/:id urls like /documents/123
}
};
var DocumentsRouteTarget = {
renderLayout: function () {
// this function is called for any url that starts with /documents
}
};
Aviator.setRoutes({
'/documents': {
target: DocumentsRouteTarget,
'/*': 'renderLayout',
'/:id': {
target: DocumentRouteTarget
'/': 'show'
}
}
});
Aviator.dispatch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment