Vybrané reakce na AngularJS 1.0

Minulý týden byla vydána verze 1.0 JavaScriptového frameworku AngularJS, a protože je to jeden z kandidátů do front-end stacku našeho projektu, procházel jsem reakce. Tady jsou ty nejzajímavější, všechny z webu Hacker News (jinde jsou spíš jen gratulace k prvnímu releasu).

Uživatel doublerebel píše:

Well, Spine has fat controllers, and AngularJS has fat views. Whether I bind the data from the controller or the view it is the same amount of work. I don’t see the immediate advantage over other frameworks.

The “Reusable Components” section states “This lets you focus either on what the application does or how the application looks separately.” However, directly below is a view (template) stuffed in a controller as a string. AngularJS uses a “ng-” namespace for data whereas Knockout and others use the HTML5 “data-” spec. These seem like a step backwards, and behind what is found in Backbone, Spine, Ember, or Knockout.

Angular also includes its own forEach, JSON parsing, isArray, isElement, isFunction, isObject, isUndefined, noop and Promises methods (and more!). Other frameworks instead rely on existing, familiar libraries like jQuery or Underscore. It even has its own Uppercase and Lowercase methods, despite existing already in native JS. Even on the AngularJS website jQuery is included, therefore many of these methods unnecessarily exist twice.

Rather than use the existing event bindings, Angular has recreated them all with an “ng” prefix. Angular also has its own testing suite rather than integrating one of the existing popular JS test frameworks like Jasmine.

Angular doesn’t seem to have any serverside equivalent for its proprietary design, so creating a fallback for less rich clients will be difficult.

I am striving to understand the distinct advantage of AngularJS, however mostly what I see is just reinventing the wheel. With so many proprietary methods, the learning curve is steeper than using a popular framework like Spine which is already extensible with common modules. It is a good effort, but against its comparables it has catching up to do.

Odpověď Vojty Jíny:

The template doesn’t have to be inlined as a string. It can be loaded from external file (html), or included within a