pcardune / handlebars-loader

A handlebars template loader for webpack
555 stars 168 forks source link

Emblem loader + handlebars loader - components lose context #83

Open andreyd-mindojo opened 8 years ago

andreyd-mindojo commented 8 years ago

We have simple structure of templates in emblem like this: parent.emblem

.parent
  == child cntxt=cntxt

child.emblem (in the same folder as parent.emblem)

.child
  | #{cntxt.title}

In sources we get template as parentTemplate = require('../templates/parent.emblem');, then do parentTemplate({cntxt: {title: 'TITLE'}}) and it returns <div class="parent"><div class="child"></div></div> without TITLE value.

We use emblem loader that just pass handlebars templates further to handlebars loader. Emblem loader seems to correctly return handlebar templates: parent

<div class="parent">{{{child cntxt=cntxt}}}</div>

child

<div class="child">{{cntxt.title}}</div>

What can cause this issue?

andreyd-mindojo commented 8 years ago

also checked with clean handlebars templates (and only handlebars-loader) <div class="parent">{{{child cntxt=cntxt}}}</div> and <div class="child">{{cntxt.title}}</div> - result is the same: <div class="parent"><div class="child"></div></div>