2016-07-06 31 views
0

我有以下dom重複,基本上需要一系列調查問題並顯示它們。聚合物檢索子元素的數據

<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> 

,並在代碼進一步下降,我想利用的答案,並創建頭記錄,所有的細節/回答記錄......頭,我可以保存沒有問題,詳細記錄,我正在嘗試做以下事情。

for(question in survey.Questions) 
{ 
    ... 
} 

獲取錯誤消息'無法找到調查'。我怎樣才能訪問我在這個頁面上顯示的一系列問題?我試過這個。$。以及我在網站和本網站上找到的其他不同的東西。

回答

0

嗯,而不是survey.questions。似乎我不得不重複一個身份證,並參考以下ID:

<template is="dom-repeat" id="testquestions" items="{{survey.Questions}}"> 
... 
... 
var item = this.$.testquestions;