File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
- import { Http , Response } from '@angular/http' ;
1
+ import { HttpClient } from '@angular/common /http' ;
2
2
3
3
import { Observable } from 'rxjs/Observable' ;
4
4
import { TranslateLoader } from '@ngx-translate/core' ;
@@ -12,7 +12,7 @@ export class TranslatePoHttpLoader implements TranslateLoader {
12
12
public domain = '' ;
13
13
14
14
constructor (
15
- protected _http : Http ,
15
+ protected _http : HttpClient ,
16
16
protected _prefix : string = 'i18n' ,
17
17
protected _suffix : string = '.po'
18
18
) {
@@ -25,8 +25,7 @@ export class TranslatePoHttpLoader implements TranslateLoader {
25
25
*/
26
26
public getTranslation ( lang : string ) : Observable < any > {
27
27
return this . _http
28
- . get ( `${ this . _prefix } /${ lang } ${ this . _suffix } ` )
29
- . map ( ( response : Response ) => response . text ( ) )
28
+ . get ( `${ this . _prefix } /${ lang } ${ this . _suffix } ` , { responseType : 'text' } )
30
29
. map ( ( contents : string ) => this . parse ( contents ) ) ;
31
30
}
32
31
You can’t perform that action at this time.
0 commit comments