Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using SC.outlet to connect objects created at runtime to other views/controllers
MyApp.TestView = SC.View.extend({
internalTestSet: SC.Set.create(),
testSet: SC.outlet('internalTestSet')
});
MyApp.TestController = SC.ObjectController.extend({
testSetBinding: 'MyApp.TestView.testSet'
});
// at console:
testView = MyApp.TestView.create();
testController = MyApp.TestController.create();
testView.get('testSet').toString(); // returns "SC.Set<>"
testController.get('testSet').toString() // returns TypeError: Result of expression 'testController.get('testSet')' [undefined] is not an object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment