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

[deleted]


It's funny because I find myself going the other direction from server-side page generation to angular.

One of the main reasons is angular forces you to separate your controller logic from DOM manipulation. Without directives I tend to see a pile of jQuery on every page.

How do you address this?


The separation between DOM and logic is indeed a nice part about AngularJS. We took a look at how much client-side logic our particular site actually needed, and it was much less than we thought. Most of the page logic can be implemented using Go's template library's own AngularJS-like server-side templates. We implemented the remainder in jQuery, which you can see at https://sourcegraph.com/static/js/web.js. (If someone in the future comes along and that link is 404, email me at sqs@sourcegraph.com if you want to see it.) It's actually a surprisingly small amount of code.

So I would say you should ask yourself how much of your controller logic needs to be done on the client? If most of it can be done on the server, then the amount of jQuery you need will probably be quite manageable.




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

Search: