Re:Facebook’s New React JavaScript Library Tutorial Rewritte...
by metaphorm on Thursday May 30, 2013 @11:49AM
(#5793214)
you should learn about the angular concept of scope before gagging on this. its actually a very elegant mechanism for letting you treat a segment of the document as lexically scoped data within your Javascript.
[ Parent
| on HN ]
Re:Facebook’s New React JavaScript Library Tutorial Rewritte...
by nobleach on Thursday May 30, 2013 @12:08PM
(#5793297)
I think he/she's going after the idea of polluting one's view with all sorts of non-standard markup invokes a gag reflex. I'm amazed that Google chose to adopt such an ugly non-standard idea. HTML5 does allow for data attributes, why on earth did Angular choose to ignore those? "ng-repeat", "ng-pooponastick" etc??? Most templating languages to not violate the actual HTML attributes to exploit their purposes. I'm not hating on Angular.js yet as I've yet to use it in a real project. But I'd hate to have to migrate a project from Angular to a more pure template.
Re:Facebook’s New React JavaScript Library Tutorial Rewritte...
by WickyNilliams on Thursday May 30, 2013 @12:40PM
(#5793521)
You can use data-* attributes in angular if you're not keen on invalid attributes e.g. data-ng-repeat. It used to be slightly broken, but I've been led to believe this is no longer the case.
As for making up your own elements as angular allows you to do, I think this is actually quite forward thinking. This is basically what the ShadowDOM[0] is all about, and when becomes common place you won't bat an eyelid seeing <NoBleachsSuperTag> in HTML.
[0] http://www.html5rocks.com/en/tutorials/webcomponents/shadowd...
Re:Facebook’s New React JavaScript Library Tutorial Rewritte...
by metaphorm on Thursday May 30, 2013 @12:41PM
(#5793524)
angular allows you to prefix any html directive with "data-" to make it fully compliant with the html5 spec.
you can certainly use <li class="some_style_class" data-ng-repeat="comment in comments"> in your angular templates and have it pass a validator for html5 and still work with angular.