Created
May 2, 2012 15:49
-
-
Save johnpapa/2577674 to your computer and use it in GitHub Desktop.
This file contains 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
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