Created
October 3, 2012 05:09
-
-
Save brian428/3825136 to your computer and use it in GitHub Desktop.
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
# Common way of making async call via underlying Ext.Ajax call | |
loadCompanies: -> | |
@companyService.loadCompanies( | |
success: ( response ) -> | |
results = Ext.decode( response.responseText ) | |
# Do something with results | |
# Do something whether the call succeeded or failed | |
failure: ( response ) -> | |
# Do something with the error | |
# Do something whether the call succeeded or failed | |
) | |
# CompanyService method using Ext.Ajax call | |
loadCompanies: ( config ) -> | |
Ext.Ajax.request( | |
url: "company/loadCompanies.json" | |
success: config.success | |
failure: config.failure | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment