2015-09-03 22:01:36 -07:00
|
|
|
library angular2.src.core.application;
|
2015-07-22 10:18:04 -07:00
|
|
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
2015-08-20 14:28:25 -07:00
|
|
|
import 'package:angular2/src/core/reflection/reflection.dart' show reflector;
|
|
|
|
import 'package:angular2/src/core/reflection/reflection_capabilities.dart'
|
2015-07-27 17:26:28 -07:00
|
|
|
show ReflectionCapabilities;
|
2015-07-22 10:18:04 -07:00
|
|
|
import 'application_common.dart';
|
|
|
|
|
2015-10-02 07:57:29 -07:00
|
|
|
import 'package:angular2/src/core/compiler/compiler.dart';
|
2015-10-02 07:37:23 -07:00
|
|
|
import 'package:angular2/src/core/linker/dynamic_component_loader.dart';
|
2015-10-20 09:38:14 -07:00
|
|
|
export 'package:angular2/src/core/linker/dynamic_component_loader.dart'
|
|
|
|
show ComponentRef;
|
2015-07-22 10:18:04 -07:00
|
|
|
|
|
|
|
/// Starts an application from a root component. This implementation uses
|
|
|
|
/// mirrors. Angular 2 transformer automatically replaces this method with a
|
|
|
|
/// static implementation (see `application_static.dart`) that does not use
|
|
|
|
/// mirrors and produces a faster and more compact JS code.
|
|
|
|
///
|
|
|
|
/// See [commonBootstrap] for detailed documentation.
|
2015-09-02 15:19:26 -07:00
|
|
|
Future<ComponentRef> bootstrap(Type appComponentType,
|
2015-10-10 22:11:13 -07:00
|
|
|
[List componentInjectableProviders]) {
|
2015-07-22 10:18:04 -07:00
|
|
|
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
2015-10-10 22:11:13 -07:00
|
|
|
var providers = [compilerProviders()];
|
|
|
|
if (componentInjectableProviders != null) {
|
|
|
|
providers.add(componentInjectableProviders);
|
2015-10-01 10:07:49 -07:00
|
|
|
}
|
2015-10-10 22:11:13 -07:00
|
|
|
return commonBootstrap(appComponentType, providers);
|
2015-07-22 10:18:04 -07:00
|
|
|
}
|