File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,9 +124,20 @@ import { LibraryPageComponent } from './components/library-page/library-page.com
124124import { KNOWN_LANGUAGES } from './models' ;
125125import { DecisionTreeComponent } from './components/decision-tree/decision-tree.component' ;
126126import { ServiceWorkerModule } from '@angular/service-worker' ;
127+ import { catchError , timeout } from 'rxjs/operators' ;
128+ import { of } from 'rxjs' ;
129+
130+ class CustomTranslateLoader extends TranslateHttpLoader {
131+ getTranslation ( lang : string ) {
132+ return super . getTranslation ( lang ) . pipe (
133+ timeout ( 3000 ) ,
134+ catchError ( ( ) => of ( { } ) )
135+ ) ;
136+ }
137+ }
127138
128139export function HttpLoaderFactory ( http : HttpClient ) {
129- return new TranslateHttpLoader ( http ) ;
140+ return new CustomTranslateLoader ( http ) ;
130141}
131142
132143export function loadTranslations (
You can’t perform that action at this time.
0 commit comments