aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/guide
diff options
context:
space:
mode:
authorIgor Minar2011-10-25 08:47:02 -0700
committerIgor Minar2011-10-26 12:57:15 -0700
commitd7ba5bc83ba9a8937384ea677331c5156ed6772d (patch)
treeaef0e0eb9873265d6f1cbe90a6f3da360e8367ca /docs/content/guide
parent950d02b4d4b1d574dfbb9bbdd56b8dc430db0a93 (diff)
downloadangular.js-d7ba5bc83ba9a8937384ea677331c5156ed6772d.tar.bz2
feat(bootstrap): drop angular.js file name restrictions for autobind
The last script element in the dom is always us if the script that contains angular is loaded synchronously. For async loading manual bootstrap needs to be performed. Close #621
Diffstat (limited to 'docs/content/guide')
-rw-r--r--docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc33
1 files changed, 17 insertions, 16 deletions
diff --git a/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc b/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc
index 10466d5e..438b3d38 100644
--- a/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc
+++ b/docs/content/guide/dev_guide.bootstrap.auto_bootstrap.ngdoc
@@ -53,8 +53,7 @@ appending `#autobind` to the `<script src=...>` URL, like in this snippet:
<!doctype html>
<html>
<head>
- <script type="text/javascript"
- src="http://code.angularjs.org/angular.js#autobind"></script>
+ <script src="http://code.angularjs.org/angular.js#autobind"></script>
</head>
<body>
<div xmlns:ng="http://angularjs.org">
@@ -67,22 +66,24 @@ appending `#autobind` to the `<script src=...>` URL, like in this snippet:
As with `ng:autobind`, you can specify an element id that should be exclusively targeted for
compilation as the value of the `#autobind`, for example: `#autobind=angularContent`.
-## Filename Restrictions for Auto-bootstrap
+If angular.js file is being combined with other scripts into a single script file, then all of the
+config options above apply to this processed script as well. That means if the contents of
+`angular.js` were appended to `all-my-scripts.js`, then the app can be bootstrapped as:
-In order for us to find the auto-bootstrap from a script attribute or URL fragment, the value of
-the `script` `src` attribute that loads the angular script must match one of these naming
-conventions:
-
-- `angular.js`
-- `angular-min.js`
-- `angular-x.x.x.js`
-- `angular-x.x.x.min.js`
-- `angular-x.x.x-xxxxxxxx.js` (dev snapshot)
-- `angular-x.x.x-xxxxxxxx.min.js` (dev snapshot)
-- `angular-bootstrap.js` (used for development of angular)
+<pre>
+ <!doctype html>
+ <html xmlns:ng="http://angularjs.org">
+ <head>
+ <script src="http://myapp.com/all-my-scripts.js" ng:autobind></script>
+ </head>
+ <body>
+ <div>
+ Hello {{'world'}}!
+ </div>
+ </body>
+ </html>
+</pre>
-Optionally, any of the filename formats above can be prepended with a relative or absolute URL that
-ends with `/`.
## Global Angular Object