Type for injection token that is used to provide locale configuration for this module and its plugins
Type for injection token used by plugins to subscribe to this module via IzPluginLink
Injection token that is used to provide locale configuration for this module and its plugins
Injection token used by plugins to subscribe to this module via IzPluginLink
This token is used for a multiprovider so it must be used with multi: true.
Wrapper for primitives to be able to distinguish between two different purposes
Locale code
Generated using TypeDoc
@ization/core
Install
Install this package and other required packages:
Configure
Import the main module of this package into your app module using
IzCoreModule.withLocalesstatic method and define locales to be used by this package:This package does nothing interesting on its own. The actual functionality is provided by plugins. See their docs for more info.
Use
IzCoreServiceServiceThis service handles locales and their preference. Supported locales are sorted in this way:
getPreferredLocaleCode()methodReturns locale code of user's preferred locale or
undefinedif none is selected.preferLocaleCode(localeCode)methodSets locale code as user's preferred locale and saves it for future use.
clearLocaleCodePreference()methodClears any saved user's preferred locale.
getLocalePreferenceChanged()methodReturns an Observable that emits (with no value) each time user's preference changes.
getLocaleCodesInOrderOfPreference()methodReturns an Observable that emits an array of locale codes each time user's preference changes.
getLocaleDefinitionsInOrderOfPreference()methodReturns an Observable that emits an array of locale definitions, including any plugin overrides, each time user's preference changes.
Develop
Build
Run
npm run build:coreto build the package into thedist/core/directory.Unit tests
Run
npm run test:coreto execute the unit tests.Linter
Run
npm run lint:coreto run linter on all code, including spec files.