5 ms·
I was just thinking about this... Suppose you're writing a web page with AngularJS. Then you find out that you need a component that is very self-contained an
by swah 14y ago
I was just thinking about this...
Suppose you're writing a web page with AngularJS.
Then you find out that you need a component that is very self-contained and of general use - let's say it is a WYSIWYG editor and let's pretend this thing doesn't exist yet (you will have to write it). Now the question:
Do you write it depending on AngularJS, or just JQuery?
- vanni 14y agoAccording to the AngularJS Developer Guide [1]: «Angular was built for the CRUD application in mind. (...) Games, and GUI editors are examples of very intensive and tricky DOM manipulation. These kinds of apps are different from CRUD apps, and as a result are not a good fit for Angular. In these cases using something closer to bare metal such as jQuery may be a better fit.» [1] http://docs.angularjs.org/guide/overview#angularsweetspot http://docs.angularjs.org/guide/overview#angularsweetspot
- modarts 14y agoI'd think Backbone plus jQuery makes more sense if you need close to the metal interaction, but still need some level of structure.
- zeeg 14y agoWhat is "close to the metal interaction" when you're talking about set of frameworks that run in an embedded interpreter that runs in a browser that runs on a GUI that runs on an OS that runs on.. oh wait.
- KaoruAoiShiho 14y agoI think you're missing the point of the question.
- vanni 14y agoI don't think so. It seems to me that the main question was: if I am already using AngularJS to develop a web page/app, is it better to develop every needed self-contained component in AngularJS or can I mix JQuery-only components with AngularJS-based code? So my answer, citing the official AngularJS documentation, was: no problem mixing AngularJS and JQuery, but some self-contained components ‒ such as a WYSIWYG editor ‒ maybe don't fit well with the AngularJS architecture. If you think that I'm missing the point yet, would you mind to elaborate on that? Thanks.
- joesb 14y agoI would prefer that a component depends only on jQuery but then provide an AngularJS directive to integrate that component into AngularJS.
- swah 14y agoSo its more or less like C: everyone wants to program on higher level languages, but everyone prefers that the libraries are written in ANSI C, so that every language can use them :)
- KaoruAoiShiho 14y agojQuery with an optional Angular directive in another git repo.