Skip to content

Instantly share code, notes, and snippets.

@MikailCliftov
Created May 12, 2011 18:20
Show Gist options
  • Save MikailCliftov/969132 to your computer and use it in GitHub Desktop.
Save MikailCliftov/969132 to your computer and use it in GitHub Desktop.
WTF
This works as an ArrayController:
Rapid.workflowCurrentApplicationController = SC.ArrayController.create({
contentBinding: SC.Binding.single('Rapid.workflowApplicationsController.selection'),
userBinding: SC.Binding.oneWay().from('Rapid.rootWorkflowController.content'),
observeMe: function(){
console.log('c '+this.get('content'));
console.log('u: '+ this.get('user'));
}.observes('content', 'user')
});
output
c Rapid.Appl.....
u: Rapid.Ste.....
Change it to an Object controller:
Rapid.workflowCurrentApplicationController = SC.ObjectController.create({
contentBinding: SC.Binding.single('Rapid.workflowApplicationsController.selection'),
userBinding: SC.Binding.oneWay().from('Rapid.rootWorkflowController.content'),
observeMe: function(){
console.log('c '+this.get('content'));
console.log('u: '+ this.get('user'));
}.observes('content', 'user')
});
c Rapid.Appl...
u: undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment