Skip to content

Instantly share code, notes, and snippets.

@joegaudet
Created September 17, 2010 20:17
Show Gist options
  • Save joegaudet/584872 to your computer and use it in GitHub Desktop.
Save joegaudet/584872 to your computer and use it in GitHub Desktop.
// In some code:
var context = SC.Object.create({foreignUrlKey:foreignUrlKey, foreignTypeKey:foreignTypeKey});
console.log(context);
object.addObserver('status', this, 'fetchForeignObjectStatusChanged',context);
// observer
fetchForeignObjectStatusChanged: function(sender, key, value, context, rev){
console.log("Arguments");
console.log("Sender: " + sender);
console.log("Key: " + key);
console.log("Status: " + value);
console.log("Context: " + context);
console.log(rev);
// for some reason outputs:
Arguments
jetty.js:63Sender: DarkHorse.DiscussionController:sc1616
jetty.js:64Key: status
jetty.js:65Status: null
jetty.js:66Context: 7
jetty.js:67undefined
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment