Live data from Hacker News

Angular 2 Beta released

angularjs.blogspot.com

271–273 of 273 posts

Re: Angular 2 Beta released

#271
post #134

Earlier quoted context omitted.

All new Google's project I see use Angular. Fiber, StarWars, Cloud Platform.. all of them.

Sure but look at the critical, consumer facing stuff: gMail doesn't use Angular, FB does use React.

They mentioned Adwords here, too. http://angularjs.blogspot.com/2015/11/highlights-from-angula...

I'd argue Adwords is one of the most important Google products.

Re: Angular 2 Beta released

#272
post #178

Earlier quoted context omitted.

Well React approach of composition has reach even others programming languages and communities and with things like redux and react-hot-loader is a game changer.

Really, React invented the idea of composition? Please, tell me more...

I never said that invented anything, just that its ideas have reached others communities (invented originally by it or not)

Re: Angular 2 Beta released

#273
post #264
post #262

Earlier quoted context omitted.

> Putting behaviour in HTML is a bad idea This is not what I'm doing. JSX is JS. I'm not putting any logic "in HTML". If I were able to express what I'm doing in mustache-style syntax, it would be: Blah blah Click me Blah Where `callback` is a reference to a JS function (rather than a string holding it's name). What's your ideal way of registering an onclick callback?

The moustache you're demonstrating there has the same problem. Add event listeners in JavaScript, not in moustache / jsx / whatever.

So, once again, JSX is JS. You're free to write the exact same thing without XML syntax. If you don't like that either, then what you're really saying is "Don't generate HTML using JS". Why not? The benefits are obvious:

* With React & ESLint you get basic checks to make sure you're not passing non-existent variables

* Your IDE understands what you're doing and lets you jump to callback definitions

* You understand what you're doing because you have one obvious place where you do templating and data binding.

* Your actual behaviour logic is still separated from your template, living in some other JS file.

On the other hand, if you add event listeners to HTML from JS the classic way, you get other problems:

* You're querying the DOM tree by CSS classes or some custom attributes. It's surely a familiar way of doing things, but also fragile and unintuitive.

* It requires your JS to know the structure of your DOM to some extent, and that structure is defined elsewhere. So it's basically the same problem as with mustache templates – passing around magic strings – but the other way around.

* Neither ESLint nor IDE will help you do it.

Post reply on HN