2015-09-03 22:01:36 -07:00
|
|
|
// Public API for Application
|
2015-10-10 22:11:13 -07:00
|
|
|
import {Provider} from './di';
|
2015-10-01 10:07:49 -07:00
|
|
|
import {Type, isPresent} from 'angular2/src/core/facade/lang';
|
|
|
|
import {Promise} from 'angular2/src/core/facade/async';
|
2015-10-10 22:11:13 -07:00
|
|
|
import {compilerProviders} from 'angular2/src/core/compiler/compiler';
|
2015-10-01 10:07:49 -07:00
|
|
|
import {commonBootstrap} from './application_common';
|
2015-10-02 07:37:23 -07:00
|
|
|
import {ComponentRef} from './linker/dynamic_component_loader';
|
2015-10-01 10:07:49 -07:00
|
|
|
|
2015-10-02 09:53:57 -07:00
|
|
|
export {APP_COMPONENT, APP_ID} from './application_tokens';
|
2015-10-01 10:07:49 -07:00
|
|
|
export {platform} from './application_common';
|
2015-09-21 16:48:16 -07:00
|
|
|
export {
|
|
|
|
PlatformRef,
|
|
|
|
ApplicationRef,
|
2015-10-20 03:05:39 +01:00
|
|
|
applicationCommonProviders,
|
2015-09-21 16:48:16 -07:00
|
|
|
createNgZone,
|
|
|
|
platformCommon,
|
2015-10-20 03:05:39 +01:00
|
|
|
platformProviders
|
2015-09-21 16:48:16 -07:00
|
|
|
} from './application_ref';
|
2015-10-01 10:07:49 -07:00
|
|
|
|
|
|
|
/// See [commonBootstrap] for detailed documentation.
|
2015-10-28 08:59:19 +01:00
|
|
|
export function bootstrap(
|
|
|
|
appComponentType: /*Type*/ any,
|
|
|
|
appProviders: Array<Type | Provider | any[]> = null): Promise<ComponentRef> {
|
2015-10-20 03:05:39 +01:00
|
|
|
var providers = [compilerProviders()];
|
|
|
|
if (isPresent(appProviders)) {
|
|
|
|
providers.push(appProviders);
|
2015-10-01 10:07:49 -07:00
|
|
|
}
|
2015-10-20 03:05:39 +01:00
|
|
|
return commonBootstrap(appComponentType, providers);
|
2015-10-02 07:37:23 -07:00
|
|
|
}
|