feat(common): allow default currency code to be configurable (#32584)

Default currency code in CurrencyPipe is currently hardcoded to USD
and is not configurable. This commit allows the default currency code
to be configurable by adding a DEFAULT_CURRENCY_CODE injection token.

Example:
```
providers: [{ provide: DEFAULT_CURRENCY_CODE, useValue: "GBP" }]
...
{{ 123.45 | currency }} // outputs £123.45 as opposed to always $123.45 before
```

Closes: #25461

PR Close #32584
This commit is contained in:
Hayouung
2019-12-14 10:39:41 +00:00
committed by atscott
parent cfbb1a1e77
commit ca1bc7e80b
9 changed files with 52 additions and 10 deletions

View File

@ -257,6 +257,8 @@ export declare const DebugNode: {
new (...args: any[]): DebugNode;
};
export declare const DEFAULT_CURRENCY_CODE: InjectionToken<string>;
/** @deprecated */
export declare class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {
readonly collection: V[] | Iterable<V> | null;