4 ms·
"templates need logic, or they quickly become unmanageably bloated and un-DRY" Maybe I'm misunderstanding this, but you can do some fancy stuff with handlebars
by laserDinosaur 14y ago
"templates need logic, or they quickly become unmanageably bloated and un-DRY"
Maybe I'm misunderstanding this, but you can do some fancy stuff with handlebars.js. You can 'foreach' through a json collection right in the template, 'if' 'else' statements and a whole whack of other cool little logic statements. So far I've not found anything I can't do in handlebars that I could do generating the page server side. Maybe I'm missing some more advanced cases or misunderstanding the term 'logic-less'?
- kapowaz 14y agoI think maybe you got the wrong end of the stick; I'd always rather go with Handlebars.js over Mustache. Plus you get nice things like helpers. Walrus looks to take it to a whole new level though, so I'm itching to try it out.