-
-
Save rklancer/866003 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 row = this.getPath('content.row') || 0, | |
column = this.getPath('content.column') || 0; | |
return { top: row * 100, left: 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