meteor-jade
meteor-jade copied to clipboard
Nothing works inside each if no content provided after
Dunno if it's bug or not. Consider this code:
each items
+Template.dynamic(template=../template data=this)
It just doesn't work, but if I add some content after all works fine.
each items
+Template.dynamic(template=../template data=this)
// now it works
---Confirmed this bug as happening also when using UI.ContentBlock to define your own components
(that thing that's supposed to make #1 missing not hurt so much...)
I'll note that this happens with things that extend spacebars too, such as {{#sortable}}---
Ignore my above comment.
This isn't really a bug per se, @RevelsGit explained an intentional situation. "this" is always the current data context, as {{this}} will literally output the value stored in "this.data (from the Template point of view.)" I would imagine this is because variables are compiled by Spacebars/Handlebars at the end of the day. Your point data=this
would require a data context on the template being used in. The point of ../template
means that the parent data context must also be set (as with ..
)
If any of this is incorrect please feel free to correct, it's speculation as to how I see it working.