
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
angular-ecmascript-intl
Advanced tools
Contains pipes to transform internationalization data using `Intl.*` browser APIs.
Contains pipes to transform internationalization data using Intl.*
browser APIs.
Install the package:
npm install angular-ecmascript-intl --save
Import the IntlModule
:
import {NgModule} from '@angular/core';
import {IntlModule} from 'angular-ecmascript-intl';
@NgModule({
imports: [
IntlModule,
],
})
export class MyModule {
}
By default, the pipe will use the browser default locale. If you want to override it, you can provide the INTL_LOCALES
injection token:
import {NgModule} from '@angular/core';
import {INTL_LOCALES} from 'angular-ecmascript-intl';
@NgModule({
providers: [
{
provide: INTL_LOCALES,
useValue: 'de-DE',
},
],
})
export class MyModule {
}
Now you can use the pipes, see below.
Use the date pipe like the following:
{{myDate | intlDate: options}}
The input date can be one of the following:
Date
objectnew Date()
constructor)The options are the same as the options for new Intl.DateTimeFormat()
. For a list of the options, see
their docs.
With the INTL_DATE_PIPE_DEFAULT_OPTIONS
injection token you can specify default options.
Use the decimal pipe like the following:
{{1.24 | intlDecimal: options}}
The input can be one of the following:
The options are the same as the options for new Intl.NumberFormat()
. For a list of the options, see
their docs.
With the INTL_DECIMAL_PIPE_DEFAULT_OPTIONS
injection token you can specify default options.
Use the percent pipe like the following:
{{0.24 | intlPercent: options}}
The input can be one of the following:
The options are the same as the options for new Intl.NumberFormat()
. For a list of the options, see
their docs.
With the INTL_PERCENT_PIPE_DEFAULT_OPTIONS
injection token you can specify default options.
Use the currency pipe like the following:
{{1.24 | intlCurrency: 'USD': options}}
The input can be one of the following:
The currency code parameter is required and must be a valid ISO 4217 currency code. If you want to transform a decimal
number instead, use the intlDecimal
pipe.
The options are the same as the options for new Intl.NumberFormat()
. For a list of the options, see
their docs.
With the INTL_CURRENCY_PIPE_DEFAULT_OPTIONS
injection token you can specify default options.
Use the language pipe like the following:
{{'en-US' | intlLanguage: options}}
The input can be one of the following:
The options are the same as the options for new Intl.DisplayNames()
. For a list of the options, see
their docs.
With the INTL_LANGUAGE_PIPE_DEFAULT_OPTIONS
injection token you can specify default options.
For more context, see the following GitHub issue
FAQs
Contains Angular pipes to transform internationalization data using Intl.* browser APIs
The npm package angular-ecmascript-intl receives a total of 215 weekly downloads. As such, angular-ecmascript-intl popularity was classified as not popular.
We found that angular-ecmascript-intl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.