@ngx-translate/http-loader
- Version 18.1.0
- Published
- 20.6 kB
- 1 dependency
- MIT license
Install
npm i @ngx-translate/http-loaderyarn add @ngx-translate/http-loaderpnpm add @ngx-translate/http-loaderOverview
http loader for dynamically loading translation files for @ngx-translate/core
Index
Variables
Functions
Classes
Interfaces
Variables
variable TRANSLATE_HTTP_LOADER_CONFIG
const TRANSLATE_HTTP_LOADER_CONFIG: InjectionToken< Partial<TranslateMultiHttpLoaderConfig>>;Functions
function provideTranslateHttpLoader
provideTranslateHttpLoader: ( config?: Partial<TranslateHttpLoaderConfig | TranslateMultiHttpLoaderConfig>) => Provider[];function provideTranslateMultiHttpLoader
provideTranslateMultiHttpLoader: ( config?: Partial<TranslateMultiHttpLoaderConfig>) => Provider[];Classes
class TranslateHttpLoader
class TranslateHttpLoader implements TranslateLoader {}constructor
constructor();property ɵfac
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateHttpLoader, never>;property ɵprov
static ɵprov: i0.ɵɵInjectableDeclaration<any>;method getTranslation
getTranslation: (lang: string) => Observable<TranslationObject>;Gets the translations from the server
Interfaces
interface TranslateHttpLoaderConfig
interface TranslateHttpLoaderConfig {}property enforceLoading
enforceLoading: boolean;property failOnError
failOnError?: boolean;If true, a failed HTTP fetch (e.g. 404) propagates the error and fails the whole language load (v17 behaviour). If false (default), each resource failure is caught and replaced with an empty object, with a
console.warnper failure; remaining resources still contribute their keys. Set this totrueif you want deploys to fail loudly on a missing translation file rather than serve partial translations. Must betruefor the translation service'sretryoption to retry HTTP failures.
property flatten
flatten?: boolean;Flatten each resource's nested objects into dotted keys before merging (default false). Later resources then override equivalent flat or nested keys. Arrays and null stay intact. Within one resource, the last encountered equivalent key wins.
property onLoadError
onLoadError?: (failure: TranslateHttpLoaderError) => void;Reports each failed resource attempt instead of the loader's default warning. Called in both failure modes; failOnError still controls error propagation. Exceptions from this callback are warned about without replacing the loading error. Does not suppress separate TranslateService warnings after a terminal loading failure.
property prefix
prefix?: string;property suffix
suffix?: string;property useHttpBackend
useHttpBackend: boolean;interface TranslateHttpLoaderError
interface TranslateHttpLoaderError {}interface TranslateHttpLoaderResource
interface TranslateHttpLoaderResource {}interface TranslateMultiHttpLoaderConfig
interface TranslateMultiHttpLoaderConfig {}property enforceLoading
enforceLoading: boolean;property failOnError
failOnError?: boolean;property flatten
flatten?: boolean;property onLoadError
onLoadError?: (failure: TranslateHttpLoaderError) => void;property resources
resources: (string | TranslateHttpLoaderResource)[];property useHttpBackend
useHttpBackend: boolean;Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (3)
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@ngx-translate/http-loader.
- Markdown[](https://www.jsdocs.io/package/@ngx-translate/http-loader)
- HTML<a href="https://www.jsdocs.io/package/@ngx-translate/http-loader"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1196 ms. - Missing or incorrect documentation? Open an issue for this package.
