Created
October 8, 2014 10:56
-
-
Save fictitious/678590f15ac431919a04 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
<!doctype html> | |
<html> | |
<head> | |
<title>core-list-test-nested-template</title> | |
<meta name="viewport" | |
content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | |
<script src="../components/platform/platform.js"> | |
</script> | |
<link rel="import" href="../components/core-list/core-list.html"> | |
<style> | |
html,body { | |
height: 100%; | |
margin: 0; | |
} | |
</style> | |
</head> | |
<body unresolved> | |
<core-list-test-nested-template></core-list-test-nested-template> | |
<polymer-element name="core-list-test-nested-template"> | |
<template> | |
<core-list data="{{myarr}}" on-core-activate="{{rowSelected}}"> | |
<ol> | |
<template> | |
<li>{{model.text}} | |
<ul> | |
<template repeat="{{model.options}}"> | |
<li>{{}}</li> | |
</template> | |
</ul> | |
</template> | |
</ol> | |
</core-list> | |
</template> | |
<script> | |
Polymer({ | |
created: function() { | |
this.myarr = [ | |
{text: "Question 1", | |
options : ["Opt a", "Opt b", "Opt c"]}, | |
{text: "Question 2", | |
options : ["Opt a", "Opt b", "Opt c"]} | |
]; | |
}, | |
rowSelected: function(evt, dtl, snd) { | |
console.dir(dtl.item); | |
console.dir(dtl.data); | |
// dtl.item and dt.data show correct value when model.text was tapped | |
// dtl.item and dt.data were undefined when any one of the model.options was tapped | |
} | |
}); | |
</script> | |
</polymer-element> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment