user825904 user825904 - 11 months ago 52
jQuery Question

How is AngularJS different from jQuery

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?

Answer Source

update: Angular2 is released. Here is a great list of resource for starters

update: Since Angular2 is coming, I would like to add more information for this topic.

  1. While Angular 1 was a framework, Angular 2 is a platform. (ref)

To developers, Angular2 provides some features beyond showing data on screen. For example, using angular2 cli tool can help you "pre-compile" your code and generate necessary javascript code (tree-shaking) to shrink the download size down to 35Kish.

  1. Angular2 emulated Shadow DOM. (ref)

This opens a door for server rendering that can address SEO issue and work with Nativescript etc that don't work on browsers.

Angular2 is RC1 now, but API is locked, which is the best timing for people to learn it.

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.