I saw a few blog articles saying that AngularJS and jQuery could be used together in one app. That seems good as jQuery has some functionalities Angular doesn't have and Angular allows us to make a greatly structured logic for a web app.
The fact is, as I'm french I also take a look at french blog articles about that, and french tends to say that we should never use jQuery and Angular together. I asked why on a forum and people said that it's probably because beginners usually use jQuery and Angular for the same things : adding elements dynamically, use ajax requests, etc... But I'd like to use jQuery for some things Angular does not do and to allow bootstrap js to work on my app.
What do you think, are jQuery and Angular bad at working together in one single app? Or does it just depend on how we make them work together?
AngularJS uses JQuery itself, the major reason not to mix and match is just what you described of them stepping on each other's toes.
While I was learning Angular a lot of the time I would end up using JQuery alongside it because I didn't understand Angular or know it's full capabilities. After learning it better my code has continuously less JQuery in it, but if I can't figure it out in angular, I'll make sure it works with JQuery until I can get it.
I guess it depends on what you're aiming for. If you want to develop an Angular app, then Angular already includes a version of jQuery called jQlite, but you can still use jQuery in your Angular app if you want to.
You can actually "wrap" jQuery code into custom Angular directives, which is pretty sweet.
In an Angular app it's safe to include jQuery if you want to implement some Bootstrap functionality. Currently, I'm doing that to implement Bootstrap's collapse component. I have only just begun developing in Angular, so I am not an expert as to all the ins-and-outs of using jQuery with Angular.
Related
I have a project handling in which already built most of its features and uses laravel and knockout js. But I want to use Vuejs on this one because I dont know yet about knockout and I like vuejs. My concern is, is it possible that I can use both witout conflicting, or im thinking to use vue for specific part of the applicaiton like, live web alerts.
please let me know the pros and cons about this, thank you.
Though this question asked quite a few times, there is no clear answers. I am beginner in Angular2. Please correct me if I am wrong. Is it wise to integrate JQuery plugins with Angular2. Imagine a JQuery plugin like JQuery UI with no proper typings available. How to implement that in Angular 2. What are the problems of using JQuery with Angular2. This question is already asked but answer is not useful.
It's clear and obvious that jQuery and
Angular are two different frameworks written above JavaScript. So it
is not recommended to use both the frameworks at same time on a single
project (either use jQuery or use Angular).
There are UI components available that are re-written using Angular without the dependency of jQuery. You can check ng-bootstrap and ngx-bootstrap which have almost all Bootstrap components written completely with Angular.
Alternatively, there is another complete UI framework for Angular based on Google's Material Design specs named Angular Material. Currently Angular Material for Angular 2 is in beta.
Also there are bundle of official UI resources that you can use and drive smoothly with Angular.
I read a stackoverflow post stating that using jquery to build a widget is better than angularjs. Their reasoning was because angularjs widget might interfere with the angularjs installed on the websites browser.
Link to the post: How to use AngularJS to build javascript widgets for public use?
It was posted in 2013, so I'm not sure if angularjs was updated to fix this issue.
If the applications are all using Angular then Angular widgets are the best asbthey give you more power and tie into the framework itaelf naturally.
If you are talking about general widgets then you want as few dependencies as possible. If you create a an Angular widget is will not be usable without Angular and people using other frameworks will not accept pulling in Angular to use your widget.
My web app mainly uses Dojo and I'm trying to implement jQuery's select2 (https://select2.github.io/). I read this and I know that it's possible to mix the two together but in my case, everything's built on top of Dojo and it's already a rather large web app. So is it still possible to implement a single jQuery widget into my Dojo based web app?
If not, would I have to go through the source code for select2 and convert into Dojo form?
I don't see why it wouldn't work. As long as there aren't any conflicts, you can use other libraries in conjunction with dojo. Now it may not be built with the AMD like everything else in dojo but it will still work fine.
After reading some of the jQuery vs ext js questions here and google search result, my understanding is that ext js is a UI building library and jQuery is a more fundamental javascript framework. I've used jQuery for a while now. It's pretty cool but in general a better (much better) javascript.
So my question is: how easy is it to use jQuery for DOM navigation/manipulation and Ext.js for UI in the same project?
There is a page on jQuery website. But the demo is too simple and the external links to Ext.js are all dead.
I'm sure it's possible, but what sort of problems and challenges would I be facing?
You might be wondering why I want to do this. Well, the Ext.js set of UI just looks much better/more polished/more feature rich then jQuery UI. I'm particularly interested in the grid.
Thanks!
Using both libraries side by side is not an issue in the technical way (just add the jquery within a script-tag, that's it!). However, you should not use jQuery for ExtJS' stuff or vice versa. Well, unless you know exactly what you do.
The actual issue can be DOM manipulations (jQuery or ExtJS Core) outside of an ExtJS component that affect an existing component.
So, in a nutshell: You can use DOM manipulations when it will not affect the ExtJS components. Otherwise use the proper way within the component itself.
Well you dont need both the libraries to live together.. Extjs has DOM manipulation api too probably not as vast as jquery but it does have the basic stuff.
Coming to Jquery, jquery has UI building APIs too if not rolled into the library there are vast no of extensions for all kinds of problems. Just try googling whatever UI you are building now with respect to jquery and you will find a library for sure.. There is jquery templates too that lets you generate HTML markup from a template defined by you and applying data objects (json) to it.. Jquery has a vast community too so most of your questios or concerns will be addressed by the community almost instantly..
So yea my suggestion would be to choose one library and stick to it and contribute to the library if there are many missing features..
Lastly I would suggest you choose Jquery.. It rocks.. period..
I think you would have no problem do this stuff... Make Ext.js your main jQuery library and jQuery as the data manipulation library for the DOM.
There would be no problem or conflicts because jQuery is compatible with other javascript libraries.