2016-07-18 03:50:31 -07:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2017-05-15 13:12:10 -07:00
|
|
|
import {ApplicationInitStatus} from './application_init';
|
2017-09-12 20:45:02 +02:00
|
|
|
import {ApplicationRef} from './application_ref';
|
2016-07-18 03:50:31 -07:00
|
|
|
import {APP_ID_RANDOM_PROVIDER} from './application_tokens';
|
|
|
|
import {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';
|
2017-01-05 20:24:37 +03:00
|
|
|
import {Inject, Optional, SkipSelf} from './di/metadata';
|
2016-08-12 16:52:55 -07:00
|
|
|
import {LOCALE_ID} from './i18n/tokens';
|
2016-07-18 03:50:31 -07:00
|
|
|
import {Compiler} from './linker/compiler';
|
|
|
|
import {NgModule} from './metadata';
|
|
|
|
|
|
|
|
export function _iterableDiffersFactory() {
|
|
|
|
return defaultIterableDiffers;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function _keyValueDiffersFactory() {
|
|
|
|
return defaultKeyValueDiffers;
|
|
|
|
}
|
|
|
|
|
2017-01-05 20:24:37 +03:00
|
|
|
export function _localeFactory(locale?: string): string {
|
|
|
|
return locale || 'en-US';
|
|
|
|
}
|
|
|
|
|
2016-07-18 03:50:31 -07:00
|
|
|
/**
|
|
|
|
* This module includes the providers of @angular/core that are needed
|
|
|
|
* to bootstrap components via `ApplicationRef`.
|
|
|
|
*
|
|
|
|
* @experimental
|
|
|
|
*/
|
|
|
|
@NgModule({
|
|
|
|
providers: [
|
2017-09-12 20:45:02 +02:00
|
|
|
ApplicationRef,
|
2016-08-02 07:54:14 -07:00
|
|
|
ApplicationInitStatus,
|
2016-07-18 03:50:31 -07:00
|
|
|
Compiler,
|
|
|
|
APP_ID_RANDOM_PROVIDER,
|
|
|
|
{provide: IterableDiffers, useFactory: _iterableDiffersFactory},
|
|
|
|
{provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory},
|
2017-01-05 20:24:37 +03:00
|
|
|
{
|
|
|
|
provide: LOCALE_ID,
|
|
|
|
useFactory: _localeFactory,
|
|
|
|
deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]
|
|
|
|
},
|
2016-07-18 03:50:31 -07:00
|
|
|
]
|
|
|
|
})
|
|
|
|
export class ApplicationModule {
|
2017-03-14 14:32:26 -07:00
|
|
|
// Inject ApplicationRef to make it eager...
|
|
|
|
constructor(appRef: ApplicationRef) {}
|
2016-07-18 03:50:31 -07:00
|
|
|
}
|