| "Server-side HTML generation"... literally each word in this phrase shows how bad things are now in 99% of websites and - what's even worse - we still have to somehow follow these things for some sucky search engine bots that still don't run JS (yandex and other crap). Let's begin from the end: generation. With a proper presentation layer, we wouldn't have to generate anything. We have data (from the server and/or local in-browser storage) and presentation modules, and we just feed data right into these modules on demand. Next: HTML. In an ideal situation, we wouldn't touch any raw HTML string at all. Presentation modules, in effect, are responsible for DOM rendering of the page parts they are in charge of. And proper partial rendering usually doesn't involve innerHTML and other raw hacks (well, maybe for quickly clearing element contents, it will do). No escaping hell and other "fun" things. Next: server-side. Screw all the dogmatic rules that the presentation layer must run on a server. The server should be responsible for handling all non-view logic providing the API for the client to communicate with (from simple AJAX/REST to something more complex like WebSockets) and serving our scripts and assets as fast as possible with proper caching headers, that's all. This model, if applied wisely, will just make everything easier. I'm in the process of writing an article on it. But as I see Angular in this stack, this particular implementation doesn't show any sign of wisdom. :) Kill the overkill and keep it simple, stupid. |