4 ms·
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 s
by doublerebel 14y ago
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.
- patrickaljord 14y ago> AngularJS uses a "ng-" namespace for data whereas Knockout and others use the HTML5 "data-" spec. You can use data-ng-* too http://news.ycombinator.com/item?id=4113317 http://news.ycombinator.com/item?id=4113317 > The "Reusable Components" section states "This lets you focus either on what the application does or how the application looks separately." This is based on the Web Component spec that many agree is the future of the web, including the twitter bootstrap crew (https://twitter.com/sayrer/status/208662599842283522 https://twitter.com/sayrer/status/208662599842283522).
- doublerebel 14y agoPerhaps data-ng-* should then be the default, as another commenter has suggested. The Web Component spec[1] examples always have the template in plain HTML, wrapped in a <template> and separate from any JavaScript. Searching the AngularJS site, there are zero references to "Web Components". Web Components are so new that the spec still has Norse mythology references, so a reference from Angular to the spec would be a big help. More importantly, while Angular has been duplicating the functionality of Underscore and jQuery, the rest of the JS world is extending itself with CommonJS modules according to spec. Half of the builtwith.angularjs.org examples include jQuery anyway. Angular's attempt to be a complete "end-to-end solution" may easily make it a jack-of-all-trades, master of none. This also seems at odds with its focus on being a component. Lastly, I am not the first person to raise these concerns.[2] [1] http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/i... [2] https://groups.google.com/group/angular/tree/browse_frm/month/2011-10/8b97d0945601b07b?rnum=11&lnk=nl https://groups.google.com/group/angular/tree/browse_frm/mont...
- patrickaljord 14y agohttps://plus.google.com/104744871076396904202/posts/1ThZhwVSnQF https://plus.google.com/104744871076396904202/posts/1ThZhwVS... From one of AngularJS author: > AngularJS is our testbed to see what works and what doesn't. We are taking the best ideas from angular and use them to shape the (Web Components) specs (and the other way around too!). As the first step, we are hoping to start to replace some pieces of angular when native apis are available. we'll see how far we'll get with this approach. What is important is that Angular can help you start thinking in the way that will be required for using these native apis and believe me that is a huge plus already. So not only do they care about Web Components, they are using AngularJS to shape the specs and vice versa. Hard to be more standard than given that the specs are still unstable. About being able to re-use the code on server side, I don't care about that, I write my apps in ruby anyway and this is out of scope of a JS MVC anyway. The only people that might care about that are Node users, and most people don't use Node or other js server side. So that's a non issue.
- jmadsen 14y ago"Angular also has its own testing suite rather than integrating one of the existing popular JS test frameworks like Jasmine." are you sure about that? pretty sure it uses Jasmine. From the tutorial: "Angular developers prefer the syntax of Jasmine's Behavior-driven Development (BDD) framework when writing tests. Although Angular does not require you to use Jasmine, we wrote all of the tests in this tutorial in Jasmine. "
- doublerebel 14y agoThere are very brief references to Jasmine in the Unit Testing[1] and Testing Services[2] sections, however the complete (proprietary) E2E testing documentation does not mention Jasmine at all.[3] [1] http://docs.angularjs.org/guide/dev_guide.unit-testing http://docs.angularjs.org/guide/dev_guide.unit-testing [2] http://docs.angularjs.org/guide/dev_guide.services.testing_services http://docs.angularjs.org/guide/dev_guide.services.testing_s... [3] http://docs.angularjs.org/guide/dev_guide.e2e-testing http://docs.angularjs.org/guide/dev_guide.e2e-testing
- joelhooks 14y agoI'm working on an app using Angular and we test via Jasmine. Angular adds some sugar on top for end to end UI testing.
- mhansen 14y agoAngular's agnostic to which testing framework you use. We test our angular app with a headless v8 running http://code.google.com/p/google-js-test/ http://code.google.com/p/google-js-test/.
- gregwebs 14y agoThe point of AngularJS is boilerplate-free 2-way data binding with plain javascript objects, which no other JS framework has. Give it a try, you will at least be able to draw much better comparisons afterwards.
- dagw 14y agoAnother framework worth taking a look it in this general category is https://github.com/elabs/serenade.js https://github.com/elabs/serenade.js. It's a lot smaller and comes with it's own haml inspired templating language (whether those are pros or cons is up to each person to decide), but it feels very much in the same spirit as AngularJS, with two-way data binding and plain javascript objects.
- vojtajina 14y agoThe template doesn't have to be inlined as a string. It can be loaded from external file (html), or included within a <script type="text/ng-template"> Having couple of util methods (forEach, isFunction, etc...), is just so that Angular can work without any other dependency, which many projects actually do. However you are free to use underscore, jquery and other libraries... Jasmine ? Yep, we like it and we use it. Angular DOES use jasmine as its unit testing framework + we provide some helpers to make your life with jasmine + angular easier. But again, you can use any testing framework you like. Angular is server agnostic. However, we have some ideas and plans how to do server side prerendering, so I believe it will come...
- mhansen 14y agoAngular doesn't include JSON parsing any more.
- ithkuil 14y ago> Does angular use the jQuery library? >Yes, angular uses jQuery, the open source DOM manipulation library. If jQuery is not present in your script path, angular falls back on its own implementation of jQuery lite. If jQuery is present in the path, angular uses it to manipulate the DOM.