r/angularjs • • Dec 15 '15

Angular 2 Beta is here!!

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

46 comments sorted by

View all comments

5

u/joshmanders Dec 15 '15 edited Dec 15 '15

I'm just not liking the way they're going. I understand that TypeScript is cool, but they're going in the wrong direction. They had a clean slate with Angular 2, and they're not making smart moves in my opinion.

Look at this boilerplate, just to get a simple Hello World app up on Angular 2 TypeScript, Angular 2 ES2015, and React.

/*
 *
 * Angular 2 "Hello World" TypeScript Application.
 *
 */

import { Component } from 'angular2/core'

@Component({
    selector: 'hello-world',
    template: '<h1>Hello World</h1>'
})
export class HelloWorld {}


/*
 *
 * Angular 2 "Hello World" JavaScript Application.
 *
 */

import Angular from 'angular2/core'

const AppComponent = Angular.Component({
    selector: 'hello-world',
    template: '<h1>Hello World</h1>'
  })
  .Class({
    constructor: function() {}
  })


/*
 *
 * React "Hello World" ES2015 Application.
 *
 */

import React from 'react'
  
export class HelloWorld extends React.Component {
  render () {
    return <h1>Hello World</h1>
  }
}

This bothers me a lot, because I love Angular 1.x and I'm not sure I can bet on that by the time 1.x is no longer supported, 2.x will not be so boilerplatey. I may be going to React.

Edit://

And React Stateless Components can make that even smaller boilerplate:

import React from 'react'

const HelloWorld = () => <h1>Hello World</h1>

9

u/Redditisshit11 Dec 16 '15

Agreed, but to play devil's advocate, its because they're making angular2 more focused on large scale apps and trying to make it as modularly defined as possible.

5

u/AbsoluteZeroK Dec 16 '15

Exactly. It's the same reason to love/hate java. So much boilerplate, but modular as fuck. I can see Angular2 being loved by the big enterprise level type places for the reason they love java.

1

u/joshmanders Dec 16 '15

I'm not sure how the difference between a React component is less modular than an Angular2 component.