r/javascript • • Dec 15 '15

Angular 2 Beta is now available

http://angularjs.blogspot.com/2015/12/angular-2-beta.html
140 Upvotes

88 comments sorted by

View all comments

Show parent comments

7

u/wreckedadvent Yavascript Dec 15 '15

I mean in general. I commented on an angular 2.0 example not too long ago here in another comment about it if you'd like to know more about why I think it's boilerplate-y.

1

u/meenie Dec 15 '15

I understand where you are coming from. And writing code like that is not for everyone. To contrast your example with Mithril, I feel a lot more comfortable writing explicit code like Angular2, rather than trying to grok everything going on in that feature packed Mithril example. The thing with making something so explicit is that you can later add some more sugar to it and create even more conventions that you don't need all the boilerplate. You could easily write your own decorator which extends the @Component decorator to make all of that less boilerplate-y.

I was listening to a live video chat with the Angular2 team saying that one of their team members, Viktor, is working on something like that already. Making a "shorthand" version to write components where you'll need the implicit knowledge of what's going on.

As of alpha.43ish they automatically include the core directives now, so no need to provide them.

7

u/wreckedadvent Yavascript Dec 15 '15

That "feature packed" mithril example is just three function calls, one of which is Array#map. There's also nothing implicit about it; I am explicitly making the element and then calling the child component directly. I guess you could say the default export is implicit if you really wanted to, but it's standard ES6 modules to me.

However, I'm glad to hear they're taking steps to reduce the boiler plate. CORE_DIRECTIVES was such a huge code smell to me, I have no idea how they didn't catch that sooner.

4

u/joshmanders Full Snack Developer Dec 15 '15

I agree completely, and I've been watching things. To be honest, I'm leaning harder at going to React over Angular 2.