The time Meteor Blaze data context screw me up

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?!


Tagged in: Javascript | MeteorJS

Get smarter in application development, machine learning, sometimes business, every Wednesday night.