dburles / dburles/meteor-spacebars-tohtml
Access parent data in html
Open
- Dominant language
- JavaScript
- Stars
- 37
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Hi first of all thanks for the great work.
I have a problem I need to access the parent template data on the server side. this is my code:
in the private folder i have this HTML
```
{{#each categories _id}}
{{#each recipes }}
{{category.nameIt}}
{{nameIt}}
{{/each}}
{{/each}}
```
and I defined recipes like this (in the server's method I call):
```
recipes: function(){
var cId = Template.parentData(0)._id
return Recipe.find({"categoryId": cId, "isActive": true});
}
```
`Template.parentData(0)._id` doesn't work.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.