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