0
我只是按照本教程中的步驟學習Polymer。聚合物明信片示例,帖子來自哪裏?
https://www.polymer-project.org/docs/start/tutorial/intro.html
對於那些你們誰做到了這一點,有一個名爲「後list.html」文件。 這裏面,有一個代碼塊是這樣
<post-service id="service" posts="{{posts}}"></post-service>
<div layout vertical center>
<template repeat="{{post in posts}}">
<post-card
favorite="{{post.favorite}}"
on-favorite-tap="{{handleFavorite}}"
hidden?="{{show == 'favorites' && !post.favorite}}">
<img src="{{post.avatar}}" width="70" height="70">
<h2>{{post.username}}</h2>
<p>{{post.text}}</p>
</post-card>
</template>
</div>
正如你可以看到「上崗」是個人明信片的實際內容。 這是從哪裏來的?沒有在教程的哪裏可以找到明信片內容的那些字符串,但明確地將它們填充在明信片中。
謝謝。這個post-service組件實際上是從位於文件夾../api/posts.json中的posts.json中提取字符串數據。 – jiminssy 2014-12-08 18:06:20