Skip to content

Instantly share code, notes, and snippets.

@johnpapa
Created May 2, 2012 15:49
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 johnpapa/2577674 to your computer and use it in GitHub Desktop.
Save johnpapa/2577674 to your computer and use it in GitHub Desktop.
my.router = (function () {
// Client-side routes
Sammy(function () {
this.get('#:folder', function () {
amplify.request({ // This would instead call the data service, not amplify
resourceId: "getFolder",
data: { folder: this.params.folder },
success: my.webmailVM.displayFolderCallback, // I don't like that it calls the VM.
error: function () {
toastR.error('oops!');
}
})
});
this.get('#:folder/:mailId', function () {
amplify.request({
resourceId: "getMail",
success: my.webmailVM.displayMailCallback,
error: function () {
toastR.error('oops!');
}
})
});
this.get('', function () { this.app.runRoute('get', '#Inbox') });
}).run();
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment