Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I tried Emberjs and Angularjs recently, as both framework offered two-way binding between view & model, at client side.

Angularjs was easy to pickup and I have completed what I wanted to do in about half a day, except one issue, angularjs template rendering is DOM driven. I wanted server-side templates, hence I have to boot phantomjs at server-side. I didn't quite like booting phantomjs for server-side templates.

Since Emberjs offered, handlebar based templates, I was happy that I could render my templates at server-side. So tried emberjs, it took about 3 days, to get it done. Many out dated tutorials & documents spread across internet about older versions of Emberjs. Documentation at emberjs.com is minimal and not helpful. I started looking at source code of discourse.org and try to understand how they used ember. I felt the power of emberjs when I needed complete control of context and rendering of nested templates. It was real beauty.



In what circumstances would you want server-side templates and how come it's easier with Handlebars?


SEO.


Not only SEO. If you need to build a webapp that is also a web page (eg: blog, wiki, cms) -- you want a rich client, but also relatively plain pages -- and ideally you want to share code/templates where it makes sense.


Also to improve "bootup time", from request to usable: server-rendered templates can be cached, can provide at least visible content before javascript even has to run and can use beefy servers & the like. At that point the client "only" has to do the events binding wiring and it's done.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: