Skip to content

Commit 826c18e

Browse files
CalvinFernandezjamesdaily
authored andcommitted
docs(bootstrap.ngdoc): clarify bootstrap example
Clear up confusion about module declaration when using manual bootstrap.
1 parent 3fe6be8 commit 826c18e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/content/guide/bootstrap.ngdoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,17 @@ Here is an example of manually initializing Angular:
9292
<script src="http://code.angularjs.org/angular.js"></script>
9393
<script>
9494
angular.element(document).ready(function() {
95-
angular.bootstrap(document, ['optionalModuleName']);
95+
angular.module('myApp', []);
96+
angular.bootstrap(document, ['myApp']);
9697
});
9798
</script>
9899
</body>
99100
</html>
100101
</pre>
101102

102103
Note that we have provided the name of our application module to be loaded into the injector as the second
103-
parameter of the {@link api/angular.bootstrap} function. This example is equivalent to using the
104-
{@link api/ng.directive:ngApp ng-app} directive, with `ng-app="optionalModuleName"`, as in the automatic
105-
initialization example above.
104+
parameter of the {@link api/angular.bootstrap} function. Notice that `angular.bootstrap` will not create modules
105+
on the fly. You must create any custom {@link guide/module modules} before you pass them as a parameter.
106106

107107
This is the sequence that your code should follow:
108108

0 commit comments

Comments
 (0)