Skip to content

Instantly share code, notes, and snippets.

@jirikrepl
Created August 2, 2017 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jirikrepl/4e40b895ac0a9b97e99e27cc63c1e602 to your computer and use it in GitHub Desktop.
Save jirikrepl/4e40b895ac0a9b97e99e27cc63c1e602 to your computer and use it in GitHub Desktop.
Template consultant_sidebarStatus used somewhere with this context ...
{{> consultant_sidebarStatus consultant=consultant}}
How template consultant_sidebarStatus looks like
<template name="consultant_sidebarStatus">
{{goldStatus}}
{{#with x=1}}
{{goldStatus}}
{{/with}}
</template>
// template helpers
Template.consultant_sidebarStatus.helpers({
goldStatus() {
console.log(Template.currentData()); // this should be reactive
console.log(this); // this should be reactive
console.log(Template.instance().data); // this should be non-reactive
},
});
// log for first helper call
Object {consultant: Object}
Object {consultant: Object}
Object {consultant: Object}
// helper called inside #with
Object {x: 1}
Object {x: 1}
Object {consultant: Object}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment