Closed eibrahim closed 10 years ago
Thanks for opening the issue. Lineman is locked to a way-too-old version of grunt-contrib-handlebars (so I'll leave this open as a note to upgrade), but in the meantime you can upgrade handlebars yourself, because any lineman dependency can be overridden by the user. All you have to do is npm i --save-dev grunt-contrib-handlebars@0.8.0
and Lineman will load it from your project's node_modules/
directory instead of loading its own (older) version.
I tried to do that and it still fails to compile sub expressions. haw can I confirm that it is compiling handlebars using the correct version?
Can you provide an example of a sub-expression? You can see the verbose output of each individual grunt task when using lineman with the -v
flag. lineman run -v
.
You can also run individual tasks with lineman grunt taskname
ie: lineman grunt handlebars -v
I got it working by using emberTemplates settings in the config\application.js file to point to my own version. I got the info from here https://github.com/dgeb/grunt-ember-templates#templatecompilerpath-and-handlebarspath
I added this to my config\application.js
"emberTemplates": {
"options": {
templateCompilerPath: 'vendor/dev/ember-template-compiler.js',
handlebarsPath: 'vendor/js/handlebars.js'
}
},
It compiles now and works like a charm and fyi, the expression i was compiling was this one:
{{#each item in pages}}
{{#link-to 'users.index' (query-params page=item.page_id) class="btn btn-default btn-sm"}}{{item.page_id}}{{/link-to}}
{{/each}}
Nice to see you got it solved @eibrahim :)
Also, of use to you in the future may be the lineman config
command which spits out configuration info and can be used to drill down to specific configurations, ie: lineman config handlebars
Oh it wasn't clear at all that you were using ember. Lineman core ships with vanilla handlebars. Do you have the lineman-ember plugin installed for basic setup of the ember handlebars task?
On Thu, Apr 17, 2014 at 4:59 PM, David Mosher notifications@github.com wrote:
Nice to see you got it solved @eibrahim :)
Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/251#issuecomment-40761989
yes, i have the ember plugin and it works great. I just wanted to upgrade my hb compilers which now works. thanks guys.
Yeah sorry about the confusion. Same instructions as post 1 should have applied but for the ember hb module.
I'll review this this weekend
On Fri, Apr 18, 2014 at 10:16 AM, eibrahim notifications@github.com wrote:
yes, i have the ember plugin and it works great. I just wanted to upgrade my hb compilers which now works. thanks guys.
Reply to this email directly or view it on GitHub: https://github.com/linemanjs/lineman/issues/251#issuecomment-40811528
This has now been addressed by upgrading dependencies directly in lineman-ember@0.0.3
How do I tell lineman to use a new version of the handlebar compiler. I am using sub-expressions and they are only supported in handlebar 1.3. Thanks.