feat(i18n): provide LOCALE_ID and NgLocalization
This commit is contained in:
committed by
Vikram Subramanian
parent
4df48b202c
commit
ce4eae65a7
@@ -10,6 +10,7 @@ import {ApplicationInitStatus} from './application_init';
|
||||
import {ApplicationRef, ApplicationRef_} from './application_ref';
|
||||
import {APP_ID_RANDOM_PROVIDER} from './application_tokens';
|
||||
import {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';
|
||||
import {LOCALE_ID} from './i18n/tokens';
|
||||
import {Compiler} from './linker/compiler';
|
||||
import {ComponentResolver} from './linker/component_resolver';
|
||||
import {DynamicComponentLoader, DynamicComponentLoader_} from './linker/dynamic_component_loader';
|
||||
@@ -51,6 +52,7 @@ export const APPLICATION_COMMON_PROVIDERS: Array<Type<any>|{[k: string]: any}|an
|
||||
{provide: IterableDiffers, useFactory: _iterableDiffersFactory},
|
||||
{provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory},
|
||||
{provide: DynamicComponentLoader, useClass: DynamicComponentLoader_},
|
||||
{provide: LOCALE_ID, useValue: 'en_US'},
|
||||
]
|
||||
})
|
||||
export class ApplicationModule {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
||||
import {LOCALE_ID} from '@angular/core';
|
||||
import {beforeEach, beforeEachProviders, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '../testing/testing_internal';
|
||||
|
||||
export function main() {
|
||||
describe('Application module', () => {
|
||||
it('should set the default locale to "en_US"',
|
||||
inject([LOCALE_ID], (defaultLocale: string) => { expect(defaultLocale).toEqual('en_US'); }));
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user