填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

DEFAULT_CURRENCY_CODE

Provide this token to set the default currency code your application uses for CurrencyPipe when there is no currency code passed into it. This is only used by CurrencyPipe and has no relation to locale currency. Defaults to USD if not configured.

查看"说明"...

      
      const DEFAULT_CURRENCY_CODE: InjectionToken<string>;
    

说明

See the i18n guide for more information.

Deprecation notice:

The default currency code is currently always USD but this is deprecated from v9.

In v10 the default currency code will be taken from the current locale.

If you need the previous behavior then set it by creating a DEFAULT_CURRENCY_CODE provider in your application NgModule:

{provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
      
      {provide: DEFAULT_CURRENCY_CODE, useValue: 'USD'}
    

使用说明

Example

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { AppModule } from './app/app.module'; platformBrowserDynamic().bootstrapModule(AppModule, { providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }] });
      
      import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';

platformBrowserDynamic().bootstrapModule(AppModule, {
  providers: [{provide: DEFAULT_CURRENCY_CODE, useValue: 'EUR' }]
});