feat(i18n): provide LOCALE_ID and NgLocalization
This commit is contained in:

committed by
Vikram Subramanian

parent
4df48b202c
commit
ce4eae65a7
@ -26,14 +26,6 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
|
||||
* ## Example
|
||||
*
|
||||
* ```
|
||||
* class MyLocalization extends NgLocalization {
|
||||
* getPluralCategory(value: any) {
|
||||
* if(value > 1) {
|
||||
* return 'other';
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* @Component({
|
||||
* selector: 'app',
|
||||
* template: `
|
||||
@ -41,7 +33,8 @@ const _INTERPOLATION_REGEXP: RegExp = /#/g;
|
||||
* {{ messages.length | i18nPlural: messageMapping }}
|
||||
* </div>
|
||||
* `,
|
||||
* providers: [{provide: NgLocalization, useClass: MyLocalization}]
|
||||
* // best practice is to define the locale at the application level
|
||||
* providers: [{provide: LOCALE_ID, useValue: 'en_US'}]
|
||||
* })
|
||||
*
|
||||
* class MyApp {
|
||||
|
Reference in New Issue
Block a user