में प्रत्येक नेस्ट करता है:क्यों अपेक्षा के अनुरूप एक ओर जहां यह प्रदान की गई है टेम्पलेट उत्पादन कुछ भी नहीं
{{#each Items}} // a collection
{{title}}
{{/each}}
{{#each types}} // another ollection
{{refId}}
{{/each}}
अगर मैं इसे एक साथ रखा:
{{#each Items}}
{{title}}
{{#each types}}
{{refId}}
{{/each}}
{{/each}}
#each types
खाली है।
टेम्पलेट सहायकों:
Template.menuItems.helpers({
restMenuItems: function() {
return RestMenuItems.find({restRefId: this._id}, {sort:Template.instance().sort.get()});
},
restMenuSideItems: function() {
return RestMenuSideItems.find({restRefId: this._id}, {sort:Template.instance().sort.get()});
}
});
Template.menuItems.onCreated(function(){
this.subscribe('restMenuItems');
this.subscribe('restMenuSideItems');
});
और टेम्पलेट कोड के कुछ:
{{#each restMenuItems}}
<div>
<select class="list-group select_side_addons">
{{#each restMenuSideItems}}
<option>{{restRefId}}</option>
{{/each}}
</select>
</div>
{{/each}}
यहां तक कि जब {{#each ../restMenuSideItems}}
द्वारा {{#each restMenuSideItems}}
की जगह, कुछ भी नहीं दिखाई देता है।
क्या गलत है?
धन्यवाद, लेकिन यह अभी भी वही है। –
अजीब, यह काम करना चाहिए। क्या आप अधिक कोड प्रदान कर सकते हैं (उदा।, आपके सहायक और अधिक संपूर्ण टेम्पलेट कोड)? 'आइटम 'और' प्रकार 'कहां से आते हैं? – MasterAM
बस किया। @MasterAM –