@@ -266,25 +266,41 @@ describe('angular', function(){
266266 } ) ;
267267
268268
269- it ( 'should extract angular config from the ng: attributes' , function ( ) {
269+ it ( 'should extract angular config from the ng: attributes' ,
270+ function ( ) {
270271 var doc = { getElementsByTagName : function ( tagName ) {
271272 expect ( lowercase ( tagName ) ) . toEqual ( 'script' ) ;
272273 return [ { nodeName : 'SCRIPT' ,
273274 src : 'angularjs/angular.js' ,
274- attributes : [ { name : 'ng:autobind' , value :undefined } ,
275+ attributes : [ { name : 'ng:autobind' , value :'elementIdToCompile' } ,
275276 { name : 'ng:css' , value : 'css/my_custom_angular.css' } ,
276277 { name : 'ng:ie-compat' , value : 'myjs/angular-ie-compat.js' } ,
277278 { name : 'ng:ie-compat-id' , value : 'ngcompat' } ] } ] ;
278279 } } ;
279280
280281 expect ( angularJsConfig ( doc ) ) . toEqual ( { base_url : 'angularjs/' ,
281- autobind : true ,
282+ autobind : 'elementIdToCompile' ,
282283 css : 'css/my_custom_angular.css' ,
283284 ie_compat : 'myjs/angular-ie-compat.js' ,
284285 ie_compat_id : 'ngcompat' } ) ;
285286 } ) ;
286287
287288
289+ it ( 'should extract angular config and default autobind value to true if present' , function ( ) {
290+ var doc = { getElementsByTagName : function ( tagName ) {
291+ expect ( lowercase ( tagName ) ) . toEqual ( 'script' ) ;
292+ return [ { nodeName : 'SCRIPT' ,
293+ src : 'angularjs/angular.js' ,
294+ attributes : [ { name : 'ng:autobind' , value :undefined } ] } ] ;
295+ } } ;
296+
297+ expect ( angularJsConfig ( doc ) ) . toEqual ( { autobind : true ,
298+ base_url : 'angularjs/' ,
299+ ie_compat_id : 'ng-ie-compat' ,
300+ ie_compat : 'angularjs/angular-ie-compat.js' } ) ;
301+ } ) ;
302+
303+
288304 it ( 'should extract angular autobind config from the script hashpath attributes' , function ( ) {
289305 var doc = { getElementsByTagName : function ( tagName ) {
290306 expect ( lowercase ( tagName ) ) . toEqual ( 'script' ) ;
@@ -299,6 +315,20 @@ describe('angular', function(){
299315 } ) ;
300316
301317
318+ it ( 'should extract autobind config with element id from the script hashpath' , function ( ) {
319+ var doc = { getElementsByTagName : function ( tagName ) {
320+ expect ( lowercase ( tagName ) ) . toEqual ( 'script' ) ;
321+ return [ { nodeName : 'SCRIPT' ,
322+ src : 'angularjs/angular.js#autobind=foo' } ] ;
323+ } } ;
324+
325+ expect ( angularJsConfig ( doc ) ) . toEqual ( { base_url : 'angularjs/' ,
326+ autobind : 'foo' ,
327+ ie_compat : 'angularjs/angular-ie-compat.js' ,
328+ ie_compat_id : 'ng-ie-compat' } ) ;
329+ } ) ;
330+
331+
302332 it ( "should default to versioned ie-compat file if angular file is versioned" , function ( ) {
303333 var doc = { getElementsByTagName : function ( tagName ) {
304334 expect ( lowercase ( tagName ) ) . toEqual ( 'script' ) ;
0 commit comments