@larscom/ngx-translate-module-loader
Advanced tools
Comparing version 3.0.7 to 3.1.0
@@ -0,1 +1,2 @@ | ||
import { HttpHeaders } from '@angular/common/http'; | ||
import { IModuleTranslation } from './module-translation'; | ||
@@ -37,2 +38,8 @@ import { Translation } from './translation'; | ||
translateMerger?: (translations: Translation[]) => Translation; | ||
/** | ||
* Provide custom headers at 'root' level, which means this headers gets added to every request | ||
* unless you specify headers at 'module' level. | ||
* @see modules | ||
*/ | ||
headers?: HttpHeaders; | ||
} |
@@ -0,1 +1,2 @@ | ||
import { HttpHeaders } from '@angular/common/http'; | ||
import { Translation } from './translation'; | ||
@@ -43,2 +44,6 @@ export interface IModuleTranslation { | ||
pathTemplate?: string; | ||
/** | ||
* Provide custom headers at 'module' level. These headers only apply to this module. | ||
*/ | ||
headers?: HttpHeaders; | ||
} |
{ | ||
"name": "@larscom/ngx-translate-module-loader", | ||
"version": "3.0.7", | ||
"version": "3.1.0", | ||
"description": "Highly configurable and flexible translations loader for ngx-translate. Fetch multiple translations, each translation file gets it's own namespace by default", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -135,3 +135,3 @@ # @larscom/ngx-translate-module-loader | ||
```ts | ||
export interface IModuleTranslationOptions { | ||
interface IModuleTranslationOptions { | ||
/** | ||
@@ -170,2 +170,8 @@ * The translation module configurations | ||
translateMerger?: (translations: Translation[]) => Translation; | ||
/** | ||
* Provide custom headers at 'root' level, which means this headers gets added to every request | ||
* unless you specify headers at 'module' level. | ||
* @see modules | ||
*/ | ||
headers?: HttpHeaders; | ||
} | ||
@@ -175,3 +181,3 @@ ``` | ||
```ts | ||
export interface IModuleTranslation { | ||
interface IModuleTranslation { | ||
/** | ||
@@ -217,2 +223,6 @@ * The module name | ||
pathTemplate?: string; | ||
/** | ||
* Provide custom headers at 'module' level. These headers only apply to this module. | ||
*/ | ||
headers?: HttpHeaders; | ||
} | ||
@@ -241,1 +251,16 @@ ``` | ||
``` | ||
## Custom headers | ||
```ts | ||
const options: IModuleTranslationOptions = { | ||
// global headers, applied to every request, unless you specify headers at 'module' level | ||
headers: new HttpHeaders().set('Header-Name', 'Header value') | ||
modules: [ | ||
{ baseTranslateUrl }, | ||
// headers only applied to this module | ||
{ baseTranslateUrl, moduleName: 'feature1', headers: new HttpHeaders().set('Header-Name', 'Header value') }, | ||
{ baseTranslateUrl, moduleName: 'feature2' } | ||
] | ||
}; | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
63296
398
262