4 ms·
I absolutely love Backbone, but the biggest issue for me has been dealing with complex logic in the templates. Most of the time now my render() method just buil
by jscheel 14y ago
I absolutely love Backbone, but the biggest issue for me has been dealing with complex logic in the templates. Most of the time now my render() method just builds the darn elements right in there.
- hippich 14y agoas long as it is just a view and not data manipulation, what is wrong with that? You do not have to have template at all. What if your view is list generator with classes? Why having template at all?
- jscheel 14y agoIt can get pretty messy at times.
- georgedyer 14y agotry CoffeeKup: https://github.com/mauricemach/coffeekup https://github.com/mauricemach/coffeekup or Teacup: http://goodeggs.github.com/teacup/ http://goodeggs.github.com/teacup/
- jscheel 14y agoI used coffeekup back in the day, but I just can't stand the jade-style declarative html. I also used eco for a while, but it got pretty messy too. I'm picky, I know :)
- account_taken 14y agoTry https://github.com/mgutz/funcd https://github.com/mgutz/funcd. It's straight up CoffeeScript functions patterned after Markaby, Erector. Other CoffeeScript templates we tried did funky things with the context and closures didn't work as expected. And when performance is a concern, you can't beat string interpolation within CoffeeScript heredoc strings.
- jscheel 14y agoYep, that's usually how I start my render() method (using triple-quote strings). Then I wrap it in jquery and do dom manipulation on it.
- jeffmess 14y agoWhy can't people just use regular HTML for markup? Coffeescript is beautiful when you are composing short succinct functions but this just looks like more work for my brain.