@@ -83,17 +83,16 @@ var _undefined = undefined,
8383 PRIORITY_LAST = 99999 ,
8484 PRIORITY = { 'FIRST' : PRIORITY_FIRST , 'LAST' : PRIORITY_LAST , 'WATCH' :PRIORITY_WATCH } ,
8585 Error = window . Error ,
86- jQuery = window [ 'jQuery' ] || window [ '$' ] , // weirdness to make IE happy
87- _ = window [ '_' ] ,
8886 /** holds major version number for IE or NaN for real browsers */
8987 msie = parseInt ( ( / m s i e ( \d + ) / . exec ( lowercase ( navigator . userAgent ) ) || [ ] ) [ 1 ] , 10 ) ,
90- jqLite = jQuery || jqLiteWrap ,
88+ jqLite , // delay binding since jQuery could be loaded after us.
89+ jQuery , // delay binding
9190 slice = Array . prototype . slice ,
9291 push = Array . prototype . push ,
9392 error = window [ $console ] ? bind ( window [ $console ] , window [ $console ] [ 'error' ] || noop ) : noop ,
9493
9594 /** @name angular */
96- angular = window [ $angular ] || ( window [ $angular ] = { } ) ,
95+ angular = window [ $angular ] || ( window [ $angular ] = { } ) ,
9796 /** @name angular.markup */
9897 angularTextMarkup = extensionMap ( angular , 'markup' ) ,
9998 /** @name angular.attrMarkup */
@@ -1006,6 +1005,7 @@ function angularInit(config){
10061005}
10071006
10081007function angularJsConfig ( document , config ) {
1008+ bindJQuery ( ) ;
10091009 var scripts = document . getElementsByTagName ( "script" ) ,
10101010 match ;
10111011 config = extend ( {
@@ -1028,3 +1028,9 @@ function angularJsConfig(document, config) {
10281028 }
10291029 return config ;
10301030}
1031+
1032+ function bindJQuery ( ) {
1033+ // bind to jQuery if present;
1034+ jQuery = window . jQuery ;
1035+ angular . element = jqLite = jQuery || jqLiteWrap ;
1036+ }
0 commit comments