Created
March 11, 2011 15:08
-
-
Save gmoeck/865988 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
console.log('----------------- SANDBOX START -----------------') | |
var contentObjectController = SC.ObjectController.create() | |
var ContentView = SC.View.extend(SC.ContentDisplay, { | |
layout: function() { | |
var something = this.get('content') ? this.get('content') : {get: function(attribute) { return 0;} }; | |
return {top: something.get('row') * 100, left: something.get('column') * 100, height: 100, width: 100}; | |
}.property('content').cacheable() | |
}) | |
var record = Main.store.createRecord(Yobiway.Desktop, {name: 'foo'}) | |
contentObjectController.set('content', record) | |
var contentView = ContentView.create({contentBinding: 'contentObjectController.content'}) | |
SC.run(function () { | |
record.set('name', 'bar') | |
}) | |
console.log(contentView.get('content').get('name')) // 'bar' | |
console.log('----------------- SANDBOX END -----------------') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment