-
-
Save FokkeZB/5656268 to your computer and use it in GitHub Desktop.
Another workaround
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
// Fetch some User | |
var someUser = Alloy.createModel('User', { | |
id: '1234' | |
}); | |
someUser.fetch(); | |
// Alloy expects this property | |
someUser.__transform = {}; | |
var someProfile = Alloy.createController('Profile', { $model: someUser }); | |
someUser.set('name', 'New Name'); |
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
// Alloy doesn't listen to changes, so we do: | |
$model.on('change', function (model) { | |
$.name.text = model.get('name'); | |
}); |
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
<Alloy> | |
<Window> | |
<Label id="name" text="{name}" /> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment