feat(bootstrap): remove the need for explicit reflection setup in bootstrap code
BREAKING CHANGES: Dart applications and TypeScript applications meant to transpile to Dart must now import `package:angular2/bootstrap.dart` instead of `package:angular2/angular2.dart` in their bootstrap code. `package:angular2/angular2.dart` no longer export the bootstrap function. The transformer rewrites imports of `bootstrap.dart` and calls to `bootstrap` to `bootstrap_static.dart` and `bootstrapStatic` respectively.
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
/// <reference path="../../../angular2/typings/rx/rx.all.d.ts" />
|
||||
|
||||
import {bootstrap} from 'angular2/angular2';
|
||||
import {reflector} from 'angular2/src/reflection/reflection';
|
||||
import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {jsonpInjectables} from 'angular2/http';
|
||||
import {JsonpCmp} from './jsonp_comp';
|
||||
|
||||
export function main() {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
bootstrap(JsonpCmp, [jsonpInjectables]);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import {JsonpCmp} from './jsonp_comp';
|
||||
import {bootstrap} from 'angular2/angular2';
|
||||
import {reflector} from 'angular2/src/reflection/reflection';
|
||||
import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabilities';
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {jsonpInjectables} from 'angular2/http';
|
||||
|
||||
|
||||
export function main() {
|
||||
// This entry point is not transformed and exists for testing purposes.
|
||||
// See index.js for an explanation.
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
bootstrap(JsonpCmp, [jsonpInjectables]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user