Last active
August 29, 2015 14:07
-
-
Save jakub-g/d56c26b02eef32eeb7c9 to your computer and use it in GitHub Desktop.
AT: Replacing object in data model
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
{ | |
"name": "AT: Replacing object in data model", | |
"description": "", | |
"data": { | |
"myContainer": { | |
"myData": { | |
"a": 0, | |
"b": 0, | |
"c": 0 | |
} | |
} | |
} | |
} |
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
{macro main()} | |
<button {on click "updateModel" /}>Update</button> | |
<br> | |
{section { | |
macro: "printText", | |
bindRefreshTo : [{ | |
inside: this.data, | |
to: 'myContainer' | |
}] | |
}/} | |
{/macro} | |
{macro printText()} | |
Magic value is: {@aria:Text { | |
bind : { | |
text : { | |
inside: this.data.myContainer.myData, | |
to: "b" | |
} | |
} | |
}/} | |
{/macro} |
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
({ | |
$classpath:'InstantTemplateScript', | |
$prototype : { | |
updateModel: function() { | |
var newData = { | |
a: 1, | |
b: 2, | |
c: 3 | |
} | |
this.$json.setValue(this.data.myContainer, "myData", newData); | |
} | |
} | |
}) |
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
{macro main()} | |
{/macro} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created by Instant Aria Templates, viewable on http://instant.ariatemplates.com/jakub-g/d56c26b02eef32eeb7c9