【发布时间】:2013-11-21 13:40:54
【问题描述】:
我在我的流星项目中使用 Iron-router,一切都很顺利,但我遇到了一些奇怪的行为。
我为看起来像这样的项目列表设置了一个循环。
{{#each list_items}}
<div>{{user.username}}
<a href="{{link}}">Click here!</a>
</div>
{{/each}}
我的用户的 JSON 对象如下所示:
{
user: {
username: jdoe
},
images: {
low-res-url: http://example.com
},
link: http://example.com/profile
}
现在 {{user.username}} 按预期显示,但是当我尝试将 {{link}} 放在 href 中时,我从 Iron-router 收到错误消息
"You called Router.path for a route named undefined but that that route doesn't seem to exist. Are you sure you created it?"
任何帮助或建议将不胜感激。
【问题讨论】:
标签: meteor handlebars.js iron-router