Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I only know one js library and that is jQuery.
But my other coders in the group are changing AngularJS as their default library in new project.

I don't know anything about it. How is it different from jQuery?
I already have a set of functions done for similar tasks in jQuery. Can I still use jQuery stuff with AngularJS?

share|improve this question

4 Answers 4

up vote 246 down vote accepted

Basically, jQuery is a great tool for you to manipulate and control DOM elements. If you only focus on DOM elements and no Data CRUD, like building a website not web application, jQuery is the one of the top tools. (You can use AngularJS for this purpose as well.)

AngularJS is a framework. It has following features

  1. Two way data binding
  2. MVW pattern (MVC-ish)
  3. Template
  4. Custom-directive (reusable components, custom markup)
  5. REST-friendly
  6. Deep Linking (set up a link for any dynamic page)
  7. Form Validation
  8. Server Communication
  9. Localization
  10. Dependency injection
  11. Full testing environment (both unit, e2e)

check this presentation and this badass introduction

Don't forget to read the official developer guide

Or learn it from these awesome video tutorials

If you wanna watch more tutorial video, check out this post, Collection of best 60+ Angularjs tutorials.

You can use jQuery with AngularJS without any issue.

In fact, AngularJS uses jQuery lite in it. Like I said jQ is a great tool.

From FAQ

Does Angular use the jQuery library?

Yes, Angular can use jQuery if it's present in your app when the application is being bootstrapped. If jQuery is not present in your script path, Angular falls back to its own implementation of the subset of jQuery that we call jQLite.

However, don't try to use jQuery to modify the DOM in AngularJS controllers, do it in your directives.

share|improve this answer
5  
Do i have to develop the full application in Angular js or i can use that on few pages and on few apges i use simple jquery –  user825904 Oct 31 '12 at 6:26
3  
both ways are fine. –  maxisam Oct 31 '12 at 6:39
4  
+1 Great answer. I would say that Angular comes closer to the MVVM pattern though. –  GFoley83 Jul 14 '13 at 21:50
6  
I'm pretty sure Angular is a MVW –  Connor Sep 12 '13 at 4:40
1  
For several years, it was close to MVC. But now re factoring and api improvement, it is closer to MVVM. In Angular $scope,works like a VM (view Model). –  Invincible Apr 18 '14 at 6:36

I want to add something regarding AngularJS difference with jQuery from a developer's perspective.

In AngularJS you have to have a very structured view and approach on what you want to accomplish. It is scarcely following a linear fashion to complete a task, but rather, the exchanges between various objects take care of the requests and actions, which, then, is necessary as angular is an MVC-Based framework. It also requires an at least general blueprint of the finalized application, since coding depends much on how you want the interactions to be completed.

jQuery is like a free poetry, you write lines and keep some relations and momentum appropriate for your task to be accomplished.

Though, in Angular JS, you should follow some rules as well as keeping the momentum and relations proper, maybe it is more like classical Spencerian sonnet (a famous classical poet) whose poem is structural and tied to many rules.

Compared against AngularJS, jQuery is more like a collection of codes and functions (which is, as already mentioned, great for DOM manipulation and fast-effect achievement), while AngularJS is a real framework which gives the developer the ability to build an enterprise web-application with a lot of data-binding and exchange within a superbly organized-routing and management.

Furthermore, AngularJS has no dependency on jQuery to complete its task. It has two very superb features which are not found in jQuery in any sense:

1- Angular JS teaches you how to CODE and accomplish a goal, not just accomplish a goal by any means. Worth to mention that AngularJS fully utilizes the core and heart of Javascripts and paves the way for you to incorporate in your app, the techniques such as DI (dependency-injection). To work with angularJS you should (or must) learn more elevated techniques of coding with Javascript.

2- Angular JS is fully independent to handle directives and structure your app; you might then simply claim that jQuery can do the same (independence), but, indeed, AngularJS, as several times mentioned within the above lines, has independence in the most excellent possible structurally MVC-Based way.

A last note is that, there is no war of Names, since it is far disturbing to be biased, or subjective. jQuery's magnitude and greatness has been proved, but their usages and limitations( of any framework or software) are the concerns of the discussion and similar debates around.

Update:

Using AngularJS is decisive as it is expensive in terms of implementation, but founds a strong base for future expansion, transformation and maintenance of the application. AngularJS is for the New World of Web. It is targeted toward building applications which are characterized by their least resource consumption (loading only necessary resources from the server), fast response time and high degree of maintainability and extendability wrapped around a structured system.

share|improve this answer
    
"To work with angularJS you should (or must) learn more elevated techniques of coding with Javascript" - please give me examaples of what you mean be elevated techniques? –  antew Aug 14 '14 at 14:14
    
For instance, when creating neat, maintainable HTTP Services, you should create neat callbacks for your AJAX response statuses, such as success or complete. And exchanging $scope and data also requires a better understanding of Javascript Objects and Arrays. Using push() etc. I specifically stated "elevated techniques" to those people who are playing with jQuery. Of course not for a Javascript professional or even intermediate javascript programmer. –  Mostafa Talebi Aug 14 '14 at 20:10
1  
@MostafaTalebi, I liked your explanation and as a fellow Iranian, that was great. but the hero of all languages is Java. just so you know!! –  Bludream Sep 13 '14 at 11:45
    
@Bludream Well, each language has its own purposes and implementations. Java is so great, as C++ is a master god. But comparison cannot be so much fruitful in this sense. AngularJS, though, is a framework, and Javascript is more of a concept than a language. As Chrome has implemented it with Java, and Firefox has it with C++. –  Mostafa Talebi Sep 15 '14 at 5:57
    
@MostafaTalebi, I was just joking, but didn't really get that part "JavaScript is more of a concept??" what does this mean?? could you explain more? ehh is there anyway we get in touch?? –  Bludream Sep 15 '14 at 8:08

AngularJS : AngularJS is for developing heavy web applications. AngularJS can use jQuery if it’s present in the web-app when the application is being bootstrapped. If it's not present in the script path, then AngularJS falls back to its own implementation of the subset of jQuery.

JQuery : jQuery is a small, fast, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler. jQuery simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.

Read more details here: angularjs-vs-jquery

share|improve this answer

jQuery will help you build your dot com, find an element inside of the DOM! AJAX traversal manipulation, then handling animation. Providing you with versatility, an API with extensibility! jQuery is something you can’t ignore: write less, do more.

share|improve this answer
    
"jQuery will help you build your dot com" ? Proof read your answers before writing something .. –  Syed Qarib Mar 8 at 14:02

protected by Tushar Gupta Oct 13 '14 at 14:54

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.