Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

The difference between angularjs and jquery


May 08, 2021 AngularJS



Angularjs and jQuery are two of the most useful front-end development tools of the day, so let's put it simply.


The concepts are different:

Conceptually, Angularjs belongs to the front-end framework, and the code we write is called by it, while jQuery is a library that encapsulates a lot of functionality, and we need to call the API in jQuery to implement some functionality.


There are differences in development patterns

AngularJS and jQuery have completely different ideas about web application development patterns:

jQuery: Create an application by displaying the DOM in the operating browser (suitable for round-the-turn applications), which is not conducive to comprehensive unit testing for larger and more complex projects;

AngularJS: Absorbing the browser as the foundation of the application (for single-page applications) is more suitable for large and complex projects, and relatively easy for comprehensive unit testing.


What are will and apps and single-page apps?


Round application

When Web applications were in their infancy, many developers used turntable applications.

Compared to a single-page app, it's the equivalent of a multi-page app.

Pros: less requirements for browsers, more support for clients;

Cons: Load wait times are long, and each time a request loads, it requires a back-end server to handle all requests and manage all application states, which consumes a lot of bandwidth. ( At this point, because each HTML document must be self-contained, that is, each time the page is updated, the updated and unexpded content in the HTML document is sent to the server side in its entiret, resulting in many of the same content being included in each response generated from the server.)


Single-page app

Only one initial HTML document is sent to the browser in this mode, and Ajax (asynchronous) requests generated by user interaction request only smaller HTML fragments, or data to be inserted into existing display elements to the user.

The initial HTML document is not loaded or replaced again, which results in Ajax requests being executed asynchronously while the user continues to interact with the existing HTML without waiting.

Pros: Reduce the amount of data requested to the back end, reduce bandwidth pressure, and improve overall web performance.

Cons: The performance requirements for browsers are higher, and some browsers may be incompatible.


Application areas for Angular JS and jQuery

The difference between angularjs and jquery

The figure above clearly illustrates the difference between Angel JS and jQuery:

The jQuery framework is better suited when the project complexity is low, and as the project complexity increases, the jQuery framework is gradually replaced by the AngularJS framework, which is known for single-page applications and complex round applications.


Recommended reading;

jQuery micro-class - theoretical practice grasp

AngularJS tutorial

jQuery tutorial