docs(bootstrap.ngdoc): clarify bootstrap example

Clear up confusion about module declaration when using manual bootstrap.
This commit is contained in:
Calvin Fernandez 2013-08-23 18:50:08 -07:00 committed by Pete Bacon Darwin
parent 21b1d22563
commit d72fc304e0

View file

@ -92,7 +92,8 @@ Here is an example of manually initializing Angular:
<script src="http://code.angularjs.org/angular.js"></script> <script src="http://code.angularjs.org/angular.js"></script>
<script> <script>
angular.element(document).ready(function() { angular.element(document).ready(function() {
angular.bootstrap(document, ['optionalModuleName']); angular.module('myApp', []);
angular.bootstrap(document, ['myApp']);
}); });
</script> </script>
</body> </body>
@ -100,9 +101,8 @@ Here is an example of manually initializing Angular:
</pre> </pre>
Note that we have provided the name of our application module to be loaded into the injector as the second Note that we have provided the name of our application module to be loaded into the injector as the second
parameter of the {@link api/angular.bootstrap} function. This example is equivalent to using the parameter of the {@link api/angular.bootstrap} function. Notice that `angular.bootstrap` will not create modules
{@link api/ng.directive:ngApp ng-app} directive, with `ng-app="optionalModuleName"`, as in the automatic on the fly. You must create any custom {@link guide/module modules} before you pass them as a parameter.
initialization example above.
This is the sequence that your code should follow: This is the sequence that your code should follow: