
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
angular-locale
Advanced tools
Currency and Locale manager for AngularJS
<script src="angular-locale.min.js"></script>
vtex.ngLocale
angular.module 'yourApp', ['vtex.ngLocale']
LocaleService
automatically listens to this and expects lang
arguments.lang
follows 'xx-XX' format, e.g.: 'en-US'.tmhDynamicLocale
and $translate
(in this order) are called and updated with new i18n data.LocaleService
triggers this once it has set $translate
to use new language and i18n is updated.
Obs: setCurrency
is called everytime language/locale gets updated, since it will reset $locale.NUMBER_FORMATS
each time.LocaleService
triggers this once it has set $locale
according to current currency configuration.LocaleService
eventName
, Object data
with any information you want to be registered within the eventObject
for United States Dollar:currencySymbol: '$ '
decimalSeparator: ','
groupSeparator: '.'
ngPatterns:
gSize: 3
lgSize: 3
macFrac: 0
maxFrac: 2
minFrac: 2
minInt: 1
negPre: "- \u00a4"
negSuf: ""
posPre: "\u00a4"
posSuf: ""
This gets mapped into Angular's $locale
:
$locale.NUMBER_FORMATS.CURRENCY_SYM = currencyConfiguration.currencySymbol
$locale.NUMBER_FORMATS.DECIMAL_SEP = currencyConfiguration.decimalSeparator
$locale.NUMBER_FORMATS.GROUP_SEP = currencyConfiguration.groupSeparator
$locale.NUMBER_FORMATS.PATTERNS[1] = currencyConfiguration.ngPatterns
Obs: ngPatterns/NUMBER_FORMATS.PATTERNS[1] has a default value, no worries :)
Inside src
you can find this module source code, written in CoffeeScript. To build the .js
and uglify it, install npm dev-dependencies and run grunt:
(sudo) npm i
grunt
FAQs
Currency and Locale manager for AngularJS
The npm package angular-locale receives a total of 196 weekly downloads. As such, angular-locale popularity was classified as not popular.
We found that angular-locale demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.