|
1 | | -import * as app from './index_common'; |
| 1 | +import {HelloCmp} from './index_common'; |
| 2 | +import {bootstrap} from 'angular2/angular2'; |
2 | 3 | import {reflector} from 'angular2/src/reflection/reflection'; |
3 | 4 | import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities'; |
4 | 5 |
|
5 | 6 | export function main() { |
6 | | - // Initializing the reflector is only required for the Dart version of the application. |
7 | | - // When using Dart, the reflection information is not embedded by default in the source code |
8 | | - // to keep the size of the generated file small. Importing ReflectionCapabilities and initializing |
9 | | - // the reflector is required to use the reflection information from Dart mirrors. |
10 | | - // Dart mirrors are not intended to be use in production code where the transformers generate a |
11 | | - // more optimal static configuration, see index_static.js for an example. |
| 7 | + // For Dart users: Initializing the reflector is only required for the Dart version of the |
| 8 | + // application. When using Dart, the reflection information is not embedded by default in the |
| 9 | + // source code to keep the size of the generated file small. Importing ReflectionCapabilities and |
| 10 | + // initializing the reflector is required to use the reflection information from Dart mirrors. |
| 11 | + // Dart mirrors are not intended to be use in production code. |
| 12 | + // Angular 2 provides a transformer which generates static code rather than rely on reflection. |
| 13 | + // For an example, run `pub serve` on the Dart application and inspect this file in your browser. |
12 | 14 | reflector.reflectionCapabilities = new ReflectionCapabilities(); |
13 | | - app.main(); |
| 15 | + |
| 16 | + // Bootstrapping only requires specifying a root component. |
| 17 | + // The boundary between the Angular application and the rest of the page is |
| 18 | + // the shadowDom of this root component. |
| 19 | + // The selector of the component passed in is used to find where to insert the |
| 20 | + // application. |
| 21 | + // You can use the light dom of the <hello-app> tag as temporary content (for |
| 22 | + // example 'Loading...') before the application is ready. |
| 23 | + bootstrap(HelloCmp); |
14 | 24 | } |
0 commit comments