Skip to content

Instantly share code, notes, and snippets.

@mauritslamers
Forked from anonymous/datasource.js
Created April 16, 2014 13:48
Show Gist options
  • Save mauritslamers/10878408 to your computer and use it in GitHub Desktop.
Save mauritslamers/10878408 to your computer and use it in GitHub Desktop.
// somewhere in your data source:
someMethod: function () {
SC.Request.getUrl('http://your.url.here').json().notify(this, this._myCallbackMethod).send();
},
_myCallbackMethod: function (result) {
if (SC.ok(result)){
// successfully retrieved
var myData = result.get('body');
}
else {
//error
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment