Hi Daniel,

And the console log will show my posts data as a type string representation 
of my array strings. Thanks.

string [{"Name":"aaa","Address":"bbb","Phone":"1111"},
{"Name":"ccc","Address":"ddd","Phone":"2222"},
{"Name":"eee","Address":"fff","Phone":"3333"}]

BR/Roger

[email protected]於 2016年12月13日星期二 UTC+8上午11時42分28秒寫道:
>
> Hi Daniel,
>
> Thank you so much for taking the time helping me look into this problem. 
> To answer your first question, I have a post.js class running on server 
> side which will render the items list (in JSON format as I shown 
> previously) on the posts object. The code is shown as following.
>
> exports.list = function(req, res){
> scan(function(items){
> res.render('post', {title:'Title', posts : items });
> });
> };
>
> BR/Roger
>
> Daniel Llewellyn於 2016年12月13日星期二 UTC+8上午1時42分53秒寫道:
>>
>> On Mon, 12 Dec 2016 at 10:08 <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Only few posts about this topic on Stackoverflow so I came here for 
>>> help. Many people believe it is due to JSON format is incorrect as result 
>>> of parsing failure. However, I spent quite some time double check to ensure 
>>> my data format can meet JSON standard. I even verified my data with 
>>> JSON.parse() and the return result is okay. But putting the same data 
>>> object on HTML calling iron-list tag simply doesn't work. I believe there 
>>> is a flaw on the array call itself while the return error message doesn't 
>>> provide more details. Please someone help me here or I might have give up 
>>> using this wonderful web element. Thanks.
>>>
>>> <iron-list items="[[posts]]" as="item">
>>>       <template>
>>>
>>
>> Please show where you get the posts variable from, where you assign it 
>> into the variable called posts, etc. It is unclear what this variable looks 
>> like without those details. Also beneficial would be a `console.log(typeof 
>> posts, posts);` output to verify what it contains.
>>
>> By using  <%= posts %> tag on my html, I can see the correct 
>>> representation of my JSON data.
>>>
>>
>> I don't know what <%= posts %> means, but it definitely is not 
>> Polymer-enhanced-HTML or plain-HTML.
>>
>>  [{"Name":"aaa","Address":"bbb","Phone":"1111"},
>>> {"Name":"ccc","Address":"ddd","Phone":"2222"},
>>> {"Name":"eee","Address":"fff","Phone":"3333"}]
>>>
>>
>> That data looks fine.
>>
>> Dan. 
>>
>

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/37bc682f-843b-4c63-805a-1849b9dddefb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to