I'm looking for a way to write my Handlebars templates using HAML, in a Ember.js application embedded in a Rails 3.2 project.
Handlebars is 1.0.rc.1, require'd from ember-rails gem 0.7.0
Ember is 1.0.pre-90-g60e3c05
Anyway, my template now looks like that :
<div id="container">
This is my test
</div>
I'd like it to be like this :
#container
This is my test
BTW, I'v seen James Harton's Hamlbars but I could not figure out how to make it work. It kept outputing Ember.TEMPLATES["templates/choose_resort"] = Ember.Handlebars.compile("This is my test");
instead of the intended :
<div id="container">
This is my test
</div>
(even the div block is missing in the what-seems-to-be-uncompiled-code returned)
Any hint would be greatly appreciated. Thanks in advance.
Ember uses the Handlebars templating library to power your app's user interface. Handlebars templates contain static HTML and dynamic content inside Handlebars expressions, which are invoked with double curly braces: {{}} . Dynamic content inside a Handlebars expression is rendered with data-binding.
Handlebars is a simple templating language. It uses a template and an input object to generate HTML or other text formats. Handlebars templates look like regular text with embedded Handlebars expressions.
Try the new Emblem.js. It's closer to Slim than HAML but cleanest you'll get if you're fond of indented templating languages and Ember.js.
And it is the one recommended by Ember.js guide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With