E
E
Eugene Zalivadnyi2015-10-22 03:42:05
JavaScript
Eugene Zalivadnyi, 2015-10-22 03:42:05

How to use jQuery in an Angular project?

There is a project written in Angular, but I had no experience with it. We urgently need to make some changes to the frontend.
jQuery-2.1.4.min.js is included at the end of the page. Trying to use it:

$( document ).ready(function() {
    $('#content1 .list').hover(function(){   
 ...
    });
});


An error is displayed in the browser console:
Uncaught ReferenceError: $is not defined

Is it because of Angular? If so, how to be, what are the solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex K, 2015-10-22
@alexk111

First, if it's possible to do without jQuery in an Angular project, then don't use jQuery. It only makes sense to chain jQuery when you need to use a library that is linked to jQuery.
Secondly, if you still link JQuery to an Angular project, then JQuery should be loaded before Angular.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question