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.
This commit is contained in:
Rich Snapp
2014-02-20 16:49:27 -07:00
committed by Michał Gołębiowski
parent 5319621afd
commit fafcd6285a

View File

@@ -1332,8 +1332,9 @@ function snake_case(name, separator){
function bindJQuery() {
// bind to jQuery if present;
jQuery = window.jQuery;
// reset to jQuery or default to us.
if (jQuery) {
// Use jQuery if it exists with proper functionality, otherwise default to us.
// Angular 1.2+ requires jQuery 1.7.1+ for on()/off() support.
if (jQuery && jQuery.fn.on) {
jqLite = jQuery;
extend(jQuery.fn, {
scope: JQLitePrototype.scope,