To take advantage of route preloading, we first have to turn it on in our root router configuration. By default, the Angular router comes with one of two preloading strategies; preload everything withPreloadAllModules, or preload nothing withNoPreloading:
... import {RouterModule, PreloadAllModules} from '@angular/router';
Now that we have enabled preloading on our root router configuration, we have to enable lazy loading modules.For our router configuration, we must provide our lazy loaded child module in a string format using theloadChildrenproperty. We also must provide the name of the module class itself to be invoked by the preloading strategy:
With this configuration in place, the application will automatically start preloading this posts, lazy loading module after it initially bootstraps the Angular application.