Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit fafcd62

Browse files
snapwichmgol
authored andcommitted
fix(jqLite): use jQuery only if jQuery.fn.on present
Make Angular not bind to jQuery versions older than 1.7 since older versions of jQuery do not support necessary on()/off() methods.
1 parent 5319621 commit fafcd62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Angular.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1332,8 +1332,9 @@ function snake_case(name, separator){
13321332
function bindJQuery() {
13331333
// bind to jQuery if present;
13341334
jQuery = window.jQuery;
1335-
// reset to jQuery or default to us.
1336-
if (jQuery) {
1335+
// Use jQuery if it exists with proper functionality, otherwise default to us.
1336+
// Angular 1.2+ requires jQuery 1.7.1+ for on()/off() support.
1337+
if (jQuery && jQuery.fn.on) {
13371338
jqLite = jQuery;
13381339
extend(jQuery.fn, {
13391340
scope: JQLitePrototype.scope,

0 commit comments

Comments
 (0)