Created
May 12, 2011 18:20
-
-
Save MikailCliftov/969132 to your computer and use it in GitHub Desktop.
WTF
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
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