Skip to content

Instantly share code, notes, and snippets.

@davidworkman9
Created June 13, 2014 20:14
Show Gist options
  • Save davidworkman9/51405851d4e99ff7909a to your computer and use it in GitHub Desktop.
Save davidworkman9/51405851d4e99ff7909a to your computer and use it in GitHub Desktop.
Customizing data passed into a blaze template
<template name="main">
{{> my_tmpl op1=5 op2=10 }}
</template>
<template name="my_tmpl">
{{#with newData}}
{{#with}}
</template>
Template.my_tmpl.helpers({
newData: function () {
return {
op1: this.op1 > 10 ? 10 : this.op1,
op2: this.op2 < 15 ? 0 : this.op2
};
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment