feat(core): Add a long-form syntax for Angular bootstrapping.
This change adds a syntax for bootstrapping Angular on a page that allows more fine-grained control of the hierarchy created. platform() creates a platform injector (of which there can only be one). From the platform, .application() creates an Angular application including a Zone and all specified application bindings (e.g. for the DOM, HTTP, Compiler, Renderer, etc). At the application level, .bootstrap() will bootstrap the given component into that application. Closes #3852
This commit is contained in:
@@ -2,7 +2,7 @@ library angular2.src.core.bootstrap;
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'application_ref.dart';
|
||||
import 'package:angular2/src/core/compiler/dynamic_component_loader.dart' show ComponentRef;
|
||||
import 'package:angular2/src/core/reflection/reflection.dart' show reflector;
|
||||
import 'package:angular2/src/core/reflection/reflection_capabilities.dart'
|
||||
show ReflectionCapabilities;
|
||||
@@ -14,7 +14,7 @@ import 'application_common.dart';
|
||||
/// mirrors and produces a faster and more compact JS code.
|
||||
///
|
||||
/// See [commonBootstrap] for detailed documentation.
|
||||
Future<ApplicationRef> bootstrap(Type appComponentType,
|
||||
Future<ComponentRef> bootstrap(Type appComponentType,
|
||||
[List componentInjectableBindings]) {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
return commonBootstrap(appComponentType, componentInjectableBindings);
|
||||
|
||||
Reference in New Issue
Block a user