Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haml and Handlebars, how to escape a text between the '<' '>'?

I need my haml to generate a tag with '{{ }}' inside the < >. It's not an attribute, I would like it to paste plain text inside the tag. For example:

<a href="..." {{bindAttr class="App.ready:ready"}}>...</a>

I searched in the documentation but I could not find how... is this possible with the haml syntax?

like image 953
Tiago Avatar asked Mar 16 '12 14:03

Tiago


1 Answers

I use plain HTML when I need Handlebars inside opening and closing tags.

%div
  <div {{action clickAction}}>
  Click Here
  </div>

It's ugly, but since HAML has no native way of doing this, it's much better than using another library or complicated hack that somebody invented.

There's not that many of these cases anyway.

like image 59
Rok Krulec Avatar answered Oct 14 '22 14:10

Rok Krulec