import { NgModule } from '@angular/core' ; import { RouterModule } from '@angular/router' ; import { LocalizeRouterModule , LocalizeRouterSettings , LocalizeParser } from 'localize-router' ; import { LocalizeRouterHttpLoader } from 'localize-router-http-loader' ; import { TranslateService } from '@ngx-translate/core' ; import { Location } from '@angular/common' ; import { HttpClient } from '@angular/common/http' ; export function HttpLoaderFactory ( translate , location , settings , http ) { return new LocalizeRouterHttpLoader ( translate , location , settings , http ) ; } const routes = [ { path : 'lazy' , loadChildren : './+lazy/lazy.module#LazyModule' } ] ; @ NgModule ( { imports : [ RouterModule . forRoot ( routes ) , LocalizeRouterModule . forRoot ( routes , { parser : { provide : LocalizeParser , useFactory : HttpLoaderFactory , deps : [ TranslateService , Location , LocalizeRouterSettings , HttpClient ] } } ) ] , exports : [ RouterModule , LocalizeRouterModule ] } ) export class AppRoutingModule { }