
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.
29 lines
717 B
TypeScript
29 lines
717 B
TypeScript
import {MapWrapper} from 'angular2/src/facade/collection';
|
|
|
|
import {bootstrap} from 'angular2/bootstrap';
|
|
import {reflector} from 'angular2/src/reflection/reflection';
|
|
|
|
import {App} from './app';
|
|
|
|
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
|
|
import {bind} from 'angular2/di';
|
|
|
|
export function main() {
|
|
bootstrap(App, createBindings());
|
|
setupReflector();
|
|
}
|
|
|
|
function createBindings(): List {
|
|
return [bind(APP_VIEW_POOL_CAPACITY).toValue(100000)];
|
|
}
|
|
|
|
export function setupReflector() {
|
|
// TODO(kegluneq): Generate this.
|
|
reflector.registerSetters({
|
|
'style': (o, m) => {
|
|
// HACK
|
|
MapWrapper.forEach(m, function(v, k) { o.style.setProperty(k, v); });
|
|
}
|
|
});
|
|
}
|