Created
April 30, 2015 23:37
-
-
Save frankiefu/a907b471bf75fc1bbd95 to your computer and use it in GitHub Desktop.
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
<dom-module id="x-app"> | |
<template> | |
<template is="x-repeat" items="{{data.items}}"> | |
<div>{{item.name}}</div> | |
</template> | |
<button on-click="updateItem">update item</button> | |
</template> | |
</dom-module> | |
<script> | |
Polymer({ | |
is: 'x-app', | |
properties: { | |
data: Object | |
}, | |
ready: function() { | |
this.data = { | |
items: [{name: 'foo'},{name: 'bar'},{name: 'zot'}] | |
} | |
}, | |
updateItem: function() { | |
this.data.items[1] = {name: 'bar2'}; | |
this.notifyPath('data.items.1', this.data.items[1]); | |
} | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment