projects/maplander/core/src/lib/interceptors/translate/server-translate.interceptor.ts
Methods |
constructor()
|
intercept | |||||||||
intercept(request: HttpRequest
|
|||||||||
Parameters :
Returns :
any
|
import {HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
import {Injectable} from '@angular/core';
@Injectable()
export class TranslateInterceptor implements HttpInterceptor {
constructor() {
}
intercept(request: HttpRequest<any>, next: HttpHandler) {
if (request.url.includes('i18n')) {
const url = '' + request.url.replace('./assets', 'assets');
request = request.clone({
url: url
});
}
return next.handle(request);
}
}