polymer retrieving data from sub elements -
i have following dom repeat, takes array of survey question , displays them.
<template is="dom-repeat" items="{{survey.questions}}"> <template is="dom-if" restamp if="{{isformat(item.type, 'single-select')}}"> <question-singleselect question="{{item}}" auth-data="{{authdata}}"></question-singleselect> </template> <template is="dom-if" restamp if="{{isformat(item.type,'open-ended')}}"> <question-openended question="{{item}}" auth-data="{{authdata}}"></question-openended> </template>
and in code further down, want take answers, , create header record, , detail/answer records... header, can save no problem, detail records, trying following.
for(question in survey.questions) { ... }
getting error message, 'survey cannot found'. how can gain access array of questions displaying on page? have tried this.$. , other different things found on web , site.
well instead of survey.questions. seemed had give dom-repeat id , reference id following:
<template is="dom-repeat" id="testquestions" items="{{survey.questions}}"> ... ... var item = this.$.testquestions;
Comments
Post a Comment