Just started playing around with meteor and I'm trying to use iron-router
for the routing. Here is my data structure:
team
_id
name
tags:[{name,counter}]
And here is the linking I'm trying to use in the template
{{#each team.tags}}
<a href="{{ pathFor 'team' _id:parent._id query...? }}">#{{this.name}} <span class="count-list">{{this.counter}}</span></a>
{{/each}}
And my router has:
route('/team/:_id') // And I get the search through the GET property... this.params.query
So:
pathFor
?Thanks in advance.
You can make use of ../
to step back to the parent scope, which in this case appears to be teams
{{#each team.tags}}
<a href="{{pathFor 'team' _id=../_id query='queryString'}}">#{{this.name}} <span class="count-list">{{this.counter}}</span></a>
{{/each}}