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>

2

u/ogrechoker Dec 15 '15

I think react is great, but personally I think framework "boilerplate" is actually pleasant. Ember is awful (sorry wycats) because it tries to hide so many things from you.

5

u/vinnl Dec 16 '15

The main reason React has little boilerplate is not because it hides things from you, but because it does a lot less/has a more focused purpose.