Created
November 6, 2014 17:35
-
-
Save hojberg/20146c26dfdd4137ba98 to your computer and use it in GitHub Desktop.
aviator example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var DocumentRouteTarget = { | |
show: function () { | |
// this function is called for /documents/:id urls like /documents/123 | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var DocumentsRouteTarget = { | |
renderLayout: function () { | |
// this function is called for any url that starts with /documents | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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