JQuery vs AngularJS comparison is reasonable because many developers will know JQuery and wonder what that new AngularJS thing offers them. That's why the following epic stackoverflow answer has 6000+ upvotes:<p><a href="http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background" rel="nofollow">http://stackoverflow.com/questions/14994391/thinking-in-angu...</a><p>Also, bloggers will often compare them as the following article does (HN discussed it previously):<p><a href="http://okmaya.com/2014/03/12/the-reason-angular-js-will-fail/" rel="nofollow">http://okmaya.com/2014/03/12/the-reason-angular-js-will-fail...</a><p>So yes, JQuery vs AngularJS is like comparing apples & oranges but one way to reach the understanding of <i>why</i> it's apples and oranges is to explicitly compare them!<p>While many line-item features of AngularJS and JQuery do not overlap, they <i>do</i> overlap in devs' mindshare to program a web page. Hence, the comparisons will continue.
If you already understand both jQuery and AngularJS, it may seem a little silly to compare them. Like comparing a motor to a car. Yet, this article will help those that know about jQuery, and want to learn more about the strengths AngularJS has to offer. Specifically, the comparison shows what both of these tools are good at, and empowers you to know what one best fits the needs of your application.<p>There are a several factors that will help you decide whether or not to use AngularJS. In my opinion it's not so much how complex the user interface is, although that is certainly relevant. The first thing to consider is where you want to put your application logic, server-side or client-side. The more things you want to push down to the client, the more likely AngularJS will better fit your needs. Are you creating a single page application where url-to-resource routing is done in JavaScript, or will that be handled server-side? Will you be merging data with templates on the server, on the client, or both? I suggest you look at the "too long; didn't read" chart in the article, and see if you need the features AngularJS provides. How important is it to you that your client-side code is testable? While it is possible to unit test jQuery code, the way most developers write nested callbacks tightly coupled to event handlers, does not lend itself easily to isolated testing. Finally, you need to decide if your team wants to embrace the declarative style of application development advocated by AngularJS. Such as using the directive ng-click vs. $(elm).click(). This will most likely require a change in mindset, and should be carefully weighed.
I don't understand. The comparison breaks down in the very first example - where is the example of Angular's excellent DOM abstraction and compatibility magic?<p>"And then I refactored something that was bad to make it faster."<p>There's also a typo in the jQuery example.<p>There's no comparison. jQuery provides way more for actual DOM magic than Angular does.<p>> As I have outlined in this article, AngularJS can do everything that jQuery does and much more...<p>But you didn't. You didn't even provide an Angular implementation of your very <i>first</i> example.
One of the annoying sticking points with Angular for me has been that it really doesn't play nicely with jQuery or jQuery-derived components (like a lot of the awesome stuff in the jQuery-UI package).<p>Like, sure, I get it, I get it, you're a framework for doing all this high-brow enterprise single-page app stuff, you own the DOM, you have DI patterns for testability, yadda yadda yadda...why the hell is it so hard to use, say, flotr2 to draw charts with you?<p>Why does your documentation not show the (common!) example of wrapping working and existing jQuery (or AJAX, or whatever) libraries into directives/services in The One True Angular Way?<p>Sure, polymer and web components and all that happy horseshit will make things better--years from now. Some of us are trying to deliver functionality <i>today</i>. It's like the devs/community don't even acknowledge that this is a problem.
At first, I was confused. "Oranges vs. Apples!". But then, I saw the file size. I understand the article as in if you use Angular in your app, you shouldn't be also using jQuery. It is also a good way to introduce Angular to someone that has experience with jQuery. That being said, "orange vs. apples".