creationix / haml-js

Haml ported to server-side Javascript. This is a traditional server-side templating language. Tested with node-js
MIT License
900 stars 109 forks source link

if / else #32

Closed janmonschke closed 13 years ago

janmonschke commented 13 years ago

Hi there,

is there any way to add an else-case to the :if-statement? The current implementation always inserts "else{ return ''; }" in your templates. https://github.com/creationix/haml-js/blob/master/lib/haml.js#L258

/Jan

pjg commented 13 years ago

Yes, could you please add it? The best would be to have it full blown, with support for if, elsif, else and the finishing end too.

rubiii commented 13 years ago

please support :else

aaronblohowiak commented 13 years ago

I'll be tackling this in the coming weeks!

aaronblohowiak commented 13 years ago

You can now do else through executable javascript blocks, fixed in 23e2260a293cd87f640f https://github.com/creationix/haml-js/commit/23e2260a293cd87f640f4c8a6c634d42eacfd205

rubiii commented 13 years ago

looks great. thank you very much!

paulyoung commented 12 years ago

Please see this pull request for a true implementation.