feat(common): allow default currency code to be configurable (#34771)
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 #34771
This commit is contained in:
@ -89,7 +89,7 @@ import {beforeEach, describe, expect, it} from '@angular/core/testing/src/testin
|
||||
describe('CurrencyPipe', () => {
|
||||
let pipe: CurrencyPipe;
|
||||
|
||||
beforeEach(() => { pipe = new CurrencyPipe('en-US'); });
|
||||
beforeEach(() => { pipe = new CurrencyPipe('en-US', 'USD'); });
|
||||
|
||||
describe('transform', () => {
|
||||
it('should return correct value for numbers', () => {
|
||||
|
Reference in New Issue
Block a user