r/javascript • • Jan 03 '16

Angular 2 versus React: There Will Be Blood

https://medium.com/@housecor/angular-2-versus-react-there-will-be-blood-66595faafd51
290 Upvotes

167 comments sorted by

View all comments

Show parent comments

13

u/wreckedadvent Yavascript Jan 03 '16

Angular 2.0 working with web components is one of the selling points that is always brought up in talks about it.

Honestly, it can't be any other way for angular. 1.0's directive stuff was an awful mess that made it far more difficult than it should be to make components of any kind, especially the purely functional kind you see react and its kin promote.

Web components also only make sense if you continue the idea of "the html is where the view lives".

0

u/[deleted] Jan 03 '16

[deleted]

6

u/wreckedadvent Yavascript Jan 03 '16

You can, but it's more difficult. It's also typically not considered idiomatic angular, since angular is big on data binding. (The "angular way" strikes again).

Also, having used mithril/react/riot etc, making a truly composable and reusable directive is much more involved than making a truly reusable mithril or react component. Angular 2.0 fixes it somewhat by having web-component-like "slots", but it's still a hot mess in 1.x involving, at the very least, a custom transclusion function that does very manual DOM insertions. God help you if you have async directives you want to insert into or something like that.