问题
now my database is working i want the user to click on one of the things in the database to get a more detailed view but the id of the data is not inserted in the link
<template name="meineEvents">
<ul>
{{#each event}}
<li>{{name}}</li>
{{/each}}
<a href="/eventDetails/{{_id}}">mehr Details</a>
</ul>
</template>
but when i click on the link i only see the http://localhost:3000/eventDetails/
without the id behind the eventDetails/ im running Meteor 1.4 with Blaze
Thank you for your help ;)
回答1:
You need to have the anchor inside the {{#each}}
<template name="meineEvents">
<ul>
{{#each event}}
<li>{{name}}
<a href="/eventDetails/{{_id}}">mehr Details</a></li>
{{/each}}
</ul>
</template>
来源:https://stackoverflow.com/questions/41986310/meteor-passing-an-id-into-a-link