feat(i18n): provide LOCALE_ID and NgLocalization

This commit is contained in:
Victor Berchet
2016-08-12 16:52:55 -07:00
committed by Vikram Subramanian
parent 4df48b202c
commit ce4eae65a7
10 changed files with 162 additions and 122 deletions

View File

@ -6,7 +6,8 @@
* found in the LICENSE file at https://angular.io/license
*/
import {Injectable} from '@angular/core';
import {Inject, Injectable, LOCALE_ID} from '@angular/core';
/**
* @experimental
*/
@ -34,7 +35,7 @@ export function getPluralCategory(
*/
@Injectable()
export class NgLocaleLocalization extends NgLocalization {
constructor(private _locale: string) { super(); }
constructor(@Inject(LOCALE_ID) private _locale: string) { super(); }
getPluralCategory(value: any): string {
const plural = getPluralCase(this._locale, value);