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?


  • 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.

  • 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.

  • The official document site

  • Day one keynote from ng-conf 2016

  • Resource links Original: 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

  • Two way data binding
  • MVW pattern (MVC-ish)
  • Template
  • Custom-directive (reusable components, custom markup)
  • REST-friendly
  • Deep Linking (set up a link for any dynamic page)
  • Form Validation
  • Server Communication
  • Localization
  • Dependency injection
  • Full testing environment (both unit, e2e)
  • check this presentation and this great introduction

    Don't forget to read the official developer guide

    Or learn it from these awesome video tutorials

    If you want to 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, which 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.

    Update:

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


    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.


    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

    链接地址: http://www.djcxy.com/p/77554.html

    上一篇: 将模拟注入到AngularJS服务中

    下一篇: AngularJS与jQuery有什么不同?