@ngx-translate/http-loader

  • Version 18.0.0
  • Published
  • 15.9 kB
  • 1 dependency
  • MIT license

Install

npm i @ngx-translate/http-loader
yarn add @ngx-translate/http-loader
pnpm add @ngx-translate/http-loader

Overview

http loader for dynamically loading translation files for @ngx-translate/core

Index

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<TranslateHttpLoader>;

                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.warn per failure; remaining resources still contribute their keys. Set this to true if you want deploys to fail loudly on a missing translation file rather than serve partial translations.

                    property prefix

                    prefix?: string;

                      property suffix

                      suffix?: string;

                        property useHttpBackend

                        useHttpBackend: boolean;

                          interface TranslateHttpLoaderResource

                          interface TranslateHttpLoaderResource {}

                            property prefix

                            prefix: string;

                              property suffix

                              suffix?: string;

                                interface TranslateMultiHttpLoaderConfig

                                interface TranslateMultiHttpLoaderConfig {}

                                  property enforceLoading

                                  enforceLoading: boolean;

                                    property failOnError

                                    failOnError?: boolean;

                                    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 onejsDocs.io badgeto 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
                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](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>