File tree 1 file changed +2
-2
lines changed
projects/multi-http-loader/src/lib
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,15 @@ export interface TranslationResource {
12
12
export class MultiTranslateHttpLoader implements TranslateLoader {
13
13
constructor (
14
14
private _handler : HttpBackend ,
15
- private _resourcesPrefix : string [ ] | TranslationResource [ ] ,
15
+ private _resourcesPrefix : ( string | TranslationResource ) [ ] ,
16
16
) { }
17
17
18
18
public getTranslation ( lang : string ) : Observable < any > {
19
19
const requests : Observable < Object | { } > [ ] = this . _resourcesPrefix . map ( ( resource ) => {
20
20
let path : string
21
21
22
22
if ( typeof resource === 'string' ) path = `${ resource } ${ lang } .json`
23
- else path = `${ resource . prefix } ${ lang } ${ resource . suffix || '.json' } `
23
+ else path = `${ resource . prefix } ${ lang } ${ resource . suffix ?? '.json' } `
24
24
25
25
return new HttpClient ( this . _handler ) . get ( path ) . pipe (
26
26
catchError ( ( res ) => {
You can’t perform that action at this time.
0 commit comments