Kalbduke
Kalbduke

Reputation: 23

Building a Web App in AngularJS without jQuery

I've built web app using Angularjs,jQuery,jQueryUI, I want to know is it possible to build the web without jQuery ?

Upvotes: 1

Views: 498

Answers (1)

moribvndvs
moribvndvs

Reputation: 42497

AngularJS does not require jQuery. When it comes to navigating and manipulating the DOM, it comes with its own limited API called jQuery Lite, which contains a subset of jQuery functionality with only the essentials. Additional things like ajax are omitted, because Angular does it a different way and therefore it isn't needed.

If you need to use jQuery along with AngularJS (say you need some specific functionality from jQuery, or you are using a jQuery component in your AngularJS app), you can include the jquery.js file before the angular.js file, and Angular will use jQuery instead of jQLite.

jQuery UI is a different story, as it contains widgets for different UI elements. AngularJS does not have any built-in UI widgets. However, you can still use jQuery UI in an AngularJS app. However, there are caveats to note when using non-Angular components inside an Angular app so that they function properly together. It's harder to explain why that is until you have a better understanding of how Angular works, and I feel like that's outside the scope of this question. There is material available on the angularjs.org website. However, here's an article on getting jQuery UI components to work best within Angular.

There are separate modules being developed to provide commonly used widgets. For example, ui-bootstrap uses the Twitter Bootstrap CSS and recreates the widgets in pure Angular directives.

Short answer: Yes, you can create web applications completely in AngularJS without the use of jQuery or jQuery UI.

Upvotes: 1

Related Questions