I'm using Angular 2 localization support for dates and currencies.
The localization setting is done in the main application module level.
Within my app module settings if I configure the LOCALE_ID
provider magically I have the localization support.
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
providers: [
{ provide: LOCALE_ID, useValue: 'nl' }
],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Now, if I use the currency pipe on my application as follows:
@Component({
selector: 'my-app',
template: '<h1>{{title}}</h1>' +
'<div>{{convertNumber | currency}}</div>',
})
export class AppComponent {
title = 'Currency Test';
convertNumber = '12.30';
}
You can find the working example in this plnkr code.
I got this output USD 12,30
.
The currency rate for Netherlands is not USD.
Based on this issue, I have two questions:
- When I configure the
LOCALE_ID
what is happening exactly? Where's this localization file? - I don't want to see
USD
orEUR
, I'd like to see the currency sign itself. (e.g. €) In the documentation, the default configuration for currency is the currency sign(€), not the currency text(EUR).
Apparently, the localization file for Angular 2 is wrong.
How can I find this file and edit it?
Thanks.