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