In Template.rendered, this.data corresponds to the data that the template "supplied", either as a parameter or using the {{#with}} construct. the supplier is just a helper function that returns data that is available in the order template but not tied to "this.data". To solve your problem, you have several options:
Defining a parent template and moving the provider helper to this parent, you can also call the supplier order as a parameter or use {{#with block}}
<template name="parent"> {{> order vendor}} {{#with vendor}} {{> order}} {{/with}} </template> <template name="order"> {{name}} </template> Template.parent.vendor=function(){ return{ name:"Chanel", address:"Paris" }; }; Template.order.rendered=function(){
You can also register a global helper, eliminating the need for an encapsulating parent template:
Handlebars.registerHelper("vendor",function(){ return{ name:"Chanel", address:"Paris" }; });
saimeunt
source share