From 91398c3425f86edeb16a1d916913355166ab37ca Mon Sep 17 00:00:00 2001 From: PatrickJS Date: Sun, 15 Mar 2015 20:26:52 -0700 Subject: [PATCH] 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 --- modules/angular2/src/core/application.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/angular2/src/core/application.js b/modules/angular2/src/core/application.js index 98ed4dea93..52bbc992e4 100644 --- a/modules/angular2/src/core/application.js +++ b/modules/angular2/src/core/application.js @@ -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 * 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, - * which may use double-curly `{{syntax}}` without collision from Angular 2 component double-curly `{{syntax}}`. + * changes in Angular 2. This means that `index.html` can safely be processed using server-side technologies such as + * bindings. (which may use double-curly `{{ syntax }}` without collision from Angular 2 component double-curly + * `{{ syntax }}`.) * * We can use this script code: * @@ -148,7 +149,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone { * selector: 'my-app' * }) * @Template({ - * inline: 'Hello {{name}}!' + * inline: 'Hello {{ name }}!' * }) * class MyApp { * name:string; @@ -159,7 +160,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone { * } * * 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 * 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. * * @@ -216,7 +217,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone { * override default injection behavior. * - [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 */