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

Commit e9bc51c

Browse files
committed
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 7f5e0f0 commit e9bc51c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Angular.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1433,9 +1433,9 @@ function bindJQuery() {
14331433
var originalCleanData;
14341434
// bind to jQuery if present;
14351435
jQuery = window.jQuery;
1436-
1437-
// reset to jQuery or default to us.
1438-
if (jQuery) {
1436+
// Use jQuery if it exists with proper functionality, otherwise default to us.
1437+
// Angular 1.2+ requires jQuery 1.7.1+ for on()/off() support.
1438+
if (jQuery && jQuery.fn.on) {
14391439
jqLite = jQuery;
14401440
extend(jQuery.fn, {
14411441
scope: JQLitePrototype.scope,

0 commit comments

Comments
 (0)