The time Meteor Blaze data context screw me up

less than 1 minute read

Originally posted in Medium

Consider this two templates,

<template name='a'>
  
  {{> b }}
  
</template>
<template name='b'>
  
  <b class="{{if not data }}hide{{/if}}">{{ data context of b }}</b>
  
</template>

Here is another template,

<template name='a'>
  
  {{> b }}
  
</template>
<template name='b'>
  
  {{if}}<b>{{?? what is the data context here ??}}</b> {{/if}}
  
</template>

You would guess the data context will be the data context of template “b”.

Nope.

The data context is “a”

WTF?!

Updated: