diff options
| author | Igor Minar | 2011-10-30 22:15:59 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-10-31 11:34:25 -0700 |
| commit | 84873e7f4eacae7d71605b2368ee746fe30a25e3 (patch) | |
| tree | 0fa7b8867a1802165209e469c0a2bd95a9c0fb0a | |
| parent | 95fdb1231f21254f9cf6e68dcee689fb9e3a2b52 (diff) | |
| download | angular.js-84873e7f4eacae7d71605b2368ee746fe30a25e3.tar.bz2 | |
fix(angular-bootstrap): fix boostrap scripts that broke w\ 5a2dcb9a
Commit 5a2dcb9a doesn't properly modify angular-boostrap.js.
This fix resolves issues and makes both the regular and scenario
version of angular-boostrap.js functional.
| -rw-r--r-- | src/angular-bootstrap.js | 14 | ||||
| -rw-r--r-- | src/scenario/angular-bootstrap.js | 3 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/angular-bootstrap.js b/src/angular-bootstrap.js index fb2acbeb..f6a7c5aa 100644 --- a/src/angular-bootstrap.js +++ b/src/angular-bootstrap.js @@ -5,14 +5,22 @@ * (c) 2010-2011 AngularJS http://angularjs.org * License: MIT */ -(function(window) { +(function(window, document) { var filename = /^(.*\/)angular-bootstrap.js(#.*)?$/, scripts = document.getElementsByTagName("SCRIPT"), + autobind = scripts[scripts.length-1].getAttribute('ng:autobind'), + config, serverPath, match, globalVars = {}; + if (autobind) { + config = {autobind: autobind}; + } else { + config = (autobind == '') ? {autobind: true} : {} + } + for(var j = 0; j < scripts.length; j++) { match = (scripts[j].src || "").match(filename); if (match) { @@ -99,7 +107,7 @@ // empty the cache to prevent mem leaks globalVars = {}; - angularInit({autobind:true}, document); + angularInit(config, document); } if (window.addEventListener) { @@ -108,5 +116,5 @@ window.attachEvent('onload', onLoadListener); } -})(window); +})(window, document); diff --git a/src/scenario/angular-bootstrap.js b/src/scenario/angular-bootstrap.js index 35a98bda..a0012ff7 100644 --- a/src/scenario/angular-bootstrap.js +++ b/src/scenario/angular-bootstrap.js @@ -25,8 +25,7 @@ try { if (previousOnLoad) previousOnLoad(); } catch(e) {} - var config = angularJsConfig(document); - if (config.autotest) angular.scenario.setUpAndRun(config); + angular.scenario.setUpAndRun({}); }; addCSS("../../css/angular-scenario.css"); |
