docs(application.js): ensure bootstrap promise,

so people using something like systemjs won't break the promise chain and at the same time shows that it's a promise

```es6
Promise.all({
  app1: System.import('app1').then(module => module.main()),
  app2: System.import('app2').then(module => module.main()),
  app3: System.import('app3').then(module => module.main())
})
.then(function(injectors) {
  console.log('dem injectors', injectors);
});
```

Closes #967
This commit is contained in:
PatrickJS
2015-03-15 20:26:52 -07:00
committed by Misko Hevery
parent 452a724542
commit 91398c3425

View File

@ -138,8 +138,9 @@ function _createVmZone(givenReporter:Function): VmTurnZone {
* *
* An application is bootstrapped inside an existing browser DOM, typically `index.html`. Unlike Angular 1, Angular 2 * An application is bootstrapped inside an existing browser DOM, typically `index.html`. Unlike Angular 1, Angular 2
* does not compile/process bindings in `index.html`. This is mainly for security reasons, as well as architectural * does not compile/process bindings in `index.html`. This is mainly for security reasons, as well as architectural
* changes in Angular 2. This means that `index.html` can safely be processed using server-side binding technologies, * changes in Angular 2. This means that `index.html` can safely be processed using server-side technologies such as
* which may use double-curly `{{syntax}}` without collision from Angular 2 component double-curly `{{syntax}}`. * bindings. (which may use double-curly `{{ syntax }}` without collision from Angular 2 component double-curly
* `{{ syntax }}`.)
* *
* We can use this script code: * We can use this script code:
* *
@ -148,7 +149,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone {
* selector: 'my-app' * selector: 'my-app'
* }) * })
* @Template({ * @Template({
* inline: 'Hello {{name}}!' * inline: 'Hello {{ name }}!'
* }) * })
* class MyApp { * class MyApp {
* name:string; * name:string;
@ -159,7 +160,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone {
* } * }
* *
* main() { * main() {
* bootstrap(MyApp); * return bootstrap(MyApp);
* } * }
* ``` * ```
* *
@ -194,7 +195,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone {
* *
* If you need to bootstrap multiple applications that share common data, the applications must share a common * If you need to bootstrap multiple applications that share common data, the applications must share a common
* change detection and zone. To do that, create a meta-component that lists the application components in its template. * change detection and zone. To do that, create a meta-component that lists the application components in its template.
* By only invoking the bootstrap()` method once with the meta-component as its argument, you ensure that only a single * By only invoking the `bootstrap()` method once, with the meta-component as its argument, you ensure that only a single
* change detection zone is created and therefore data can be shared across the applications. * change detection zone is created and therefore data can be shared across the applications.
* *
* *
@ -216,7 +217,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone {
* override default injection behavior. * override default injection behavior.
* - [errorReporter]: `function(exception:any, stackTrace:string)` a default error reporter for unhandled exceptions. * - [errorReporter]: `function(exception:any, stackTrace:string)` a default error reporter for unhandled exceptions.
* *
* Returns the application`s private [Injector]. * Returns a [Promise] with the application`s private [Injector].
* *
* @publicModule angular2/angular2 * @publicModule angular2/angular2
*/ */