Hacker News new | ask | show | jobs
by markchatkhan 4722 days ago
These days it's all about modularizing and separating concerns.

Angular let's you create a front-end completely decoupled from a backend and backend agnostic.

Angular is also in fact completely agnostic about your model. You can plug in any kind of model as long as you can parse it in javascript.

With this kind of architecture, it's a lot easier to do things like re-use a backend for multiple front ends, for example a mobile-site and a desktop site and a native iOS app and a blackberry app. It's also easier to maintain and change each individual piece.

JS frameworks are only a front-end though, you also need to adapt your backend into a modern API style, rather than a html spitter-outter.

1 comments

> Angular is also in fact completely agnostic about your model. You can plug in any kind of model as long as you can parse it in javascript.

Why Angular has to know my model? I can make it decoupled from other parts of my code by using standard programming techniques available for many years (modularity, layers etc.).

Maybe the problem is that Angular actually implements design patterns as code, and it should be just knowledge?

It might be easier to conceptually think of these view-binding models as "View Models" or presenters. A longer article I plan to read on the subject is http://msdn.microsoft.com/en-us/magazine/hh580734.aspx
The client model does not have to be the server model, and it probably shouldn't.