Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does AngularJS really need jQuery?

Tags:

angularjs

I was reading that AngularJS comes with a lite version of jQuery. However I keep hearing reference to people who talk about Angular and jQuery going together. I even checked out ng-grid and noticed that it says:

Angular Data Grid written in AngularJS and jQuery by the AngularUI Team

So if I do use Angular just when would I need jQuery and what does the version that comes as part of AngularJS not provide?

like image 737
Alan2 Avatar asked Mar 30 '13 18:03

Alan2


People also ask

Is jQuery necessary AngularJS?

This is to minimize dependencies. Yet, if you load jQuery before angular, then angular will use jQuery. Most of the time, you do not need to use jQuery. Even so much that, for beginners, it is advised to leave out jQuery completely as there would be a tendency to use jQuery when there is an easy / angular way.

Is angular built on jQuery?

While JavaScript is used by jQuery, Angular is based on TypeScript, a derivative of Javascript programming language.

Is JavaScript necessary for AngularJS?

Since AngularJS is mainly based on HTML and JavaScript, there is no need to learn another syntax or language.

Is jQuery really needed?

You might not need jQuery. jQuery and its cousins are great, and by all means use them if it makes it easier to develop your application. If you're developing a library on the other hand, please take a moment to consider if you actually need jQuery as a dependency.


1 Answers

jQLite is a very stripped-down version of jQuery. jQLite is enough for angular to work. This is to minimize dependencies.

Yet, if you load jQuery before angular, then angular will use jQuery.

Most of the time, you do not need to use jQuery. Even so much that, for beginners, it is advised to leave out jQuery completely as there would be a tendency to use jQuery when there is an easy / angular way. There has been so many examples on this (mostly showing and hiding elements through jQuery when there are ngShow and ngHide directives).

Later on, when you start to write directives, you then may need to add jQuery.

ngGrid possibly does many things for which jqLite would not suffice. Thus, they used jQuery.

Documentation and features of jqLite: http://docs.angularjs.org/api/angular.element

like image 127
Umur Kontacı Avatar answered Sep 18 '22 06:09

Umur Kontacı