How can I use AngularJS with jquery?
-
I decided to skip javascript and learn jquery and now I am quite proficient in it. But recently I came across wonders of angularJs but was put off by the fact that it is "100% javascript". I don't want to learn JS but I want to work with angularJS!! Guidance requested.
-
Answer:
jQuery is 100% JavaScript. All this time you've been coding in JavaScript. So this question is a bit weird.
Brian Chu at Quora Visit the source
Other answers
You should know that Angular contains a smaller version of jQuery called "JQuery light" which provides some of jQuery functionality such as the event system. Usually it is recommended to make use of jQuery inside of Angular Directives which are ways of registering behavior on DOM Elements.
Roland Pangu
You can just add jquery.js to your index.html and access $ anywhere. However, Angular.js takes a different approach to manipulating the DOM than jQuery does. Usually you replace you jQuery DOM manipulation by some directive in the HTML. The official http://docs.angularjs.org/misc/faq states: Stop trying to use jQuery to modify the DOM in controllers. Really. That includes adding elements, removing elements, retrieving their contents, showing and hiding them. Use built-in directives, or write your own where necessary, to do your DOM manipulation. See below about duplicating functionality. If you're struggling to break the habit, consider removing jQuery from your app. Really. Angular has the $http service and powerful directives that make it almost always unnecessary. Angular's bundled jQLite has a handful of the features most commonly used in writing Angular directives, especially binding to events.
Nicolai Kamenzky
Forget JQuery and use Angular. jQuery was created for browser portability and desktop dominated web development. It's not optimized for mobile kind of environment. Having said that, jQuery have lots of good components which are stable n can be taken in angular. Note: It's hard to unlearn than learn.
Chandra Singh Meena
Related Q & A:
- How can I use SSL with django?Best solution by Stack Overflow
- How can I use XMP in Sharepoint metadata?Best solution by Stack Overflow
- How can I use mongo-sync?Best solution by github.com
- How can I use real time social data from Datasift and perform real time analytics on it?Best solution by Quora
- How can I use several windows by Ribbon?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.