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

Commit fd8e990

Browse files
Michel Boudreaumboudreau
Michel Boudreau
authored andcommitted
changing the logic behind ngJq to be more robust; removing jQuery = window[jqName] for when jqName is empty string
1 parent 3d8246d commit fd8e990

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Angular.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ var jq = function() {
950950

951951
var name;
952952
if (el) {
953-
name = getNgAttribute(el, "jq") || '';
953+
name = getNgAttribute(el, "jq");
954954
}
955955

956956
return (jq.name_ = name);
@@ -1528,7 +1528,10 @@ function bindJQuery() {
15281528

15291529
// bind to jQuery if present;
15301530
var jqName = jq();
1531-
jQuery = jqName != null ? window[jqName] : window.jQuery;
1531+
jQuery = window.jQuery; // use default jQuery.
1532+
if (isDefined(jqName)) { // `ngJq` present
1533+
jQuery = jqName === null ? undefined : window[jqName]; // if empty; use jqLite. if not empty, use jQuery specified by `ngJq`.
1534+
}
15321535

15331536
// Use jQuery if it exists with proper functionality, otherwise default to us.
15341537
// Angular 1.2+ requires jQuery 1.7+ for on()/off() support.

0 commit comments

Comments
 (0)