I am implementing lazy loading technique in an Angular6 project, but I am confused as for the syntax to fetch the "lazy" module.
Inside the app.module (main module), when declaring the Routes, I would like to ask if the following:
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule' }
is equivalent to the following:
import { LazyModule } from './lazy/lazy.module';
{ path: 'lazy', loadChildren: () => LazyModule }
Through my eyes, the second approach actually makes useless the lazy loading since the LazyModule has to already been imported in order to call it. In the first approach, I successfully call the LazyModule without having to import it.
Any help is welcome.