So I spent some time this week to fiddle with Angular.js. They have a great tutorial worth checking out. But truth be told, I really didn’t like it and as far as I’m concerned, I don’t want to work with it in the future. I’ll tell you why:
- Angular doesn’t tolerate full separation between structure, code and style
- Angular works only on client side
The great benefit in using XSLT for templates is that it can be rendered on both client-side and server-side (and by any language!), so you don’t need to write the code twice.
- Using angular template means making an extra call to the server
Each call to the server has a lot of overhead and slows down the page-loading. This is also true for client-side XSLT, but the big difference is that one XSLT can hold many templates (so you’ll get 1 additional call) while in Angular, each template is a file on its own (so you’ll get a gazzilion calls. Lucky for you they’re cached).
- Angular encourages user to invent new HTML tags
That might sound great because the developer can easily read the page skeleton but as a designer it’s bad, because you can’t tell what are the HTML elements formulate the new element. for example:
<products> <product></product> <products>
while this version maybe less readable, but contains the same information and is much more easy to understand:
<ul class="products"> <li class="product">...</li> </ul>
So I prefer to stick with my XSLT, which works on both client and server sides and can be used by any language and is provides better performance than Angular.JS (less calls, computes on the server)