Closed tkellen closed 9 years ago
Great question ... @rjackson any ideas on this one?
@first
also fails.
Given a test.hbs
file:
<ul>
{{#each items}}
<li {{#if @first}}class="first"{{/if}}>{{title}}</li>
{{/each}}
</ul>
and a compile.js
file:
var fs = require('fs');
var compiler = require('ember-template-compiler');
var template = fs.readFileSync('test.hbs').toString();
var input = compiler.precompile(template).toString();
console.log(input);
When I run node compile.js
, I get a cryptic error:
undefined:10
stack1 = helpers['if'].call(depth0, , {hash:{},hashTypes:{},hashContexts:{},
^
SyntaxError: Unexpected token ,
at Object.Function (<anonymous>)
at Object.JavaScriptCompiler.createFunctionContext (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:189:23)
at Object.JavaScriptCompiler.compile (./node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:115:17)
at Object.Ember.Handlebars.precompile (./node_modules/ember-template-compiler/vendor/ember-template-compiler.js:285:52)
at Object.<anonymous> (./compile.js:4:22)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
Package versions:
I spoke with an ember core team member this week at EmberConf and it doesn't sound like this will be getting any love w/out a fix from the community. Does anyone want to dive into the ember project and see how to add support for these?
Ember does not support @index
(or any of the other @data
type properties).
Works fine with handlebars proper. Any idea what might be up?