In the following code, beside the fact that in the first example, we need to import productsModule to the file, What is the difference between these two ways of loading a route lazily?
{ path: 'products', loadchildren: () => productsModule }
vs
{ path: 'products', loadchildren: 'app/products/products.module#ProductsModule' }
{ path: 'products', loadchildren: 'app/products/products.module#ProductsModule' }
Its a deprecated way for lazy loaded modules for Angular 8.
loadChildren route configs should be changed from a string such as
{ path: 'products', loadchildren: () => productsModule }
https://angular.io/guide/deprecations#loadchildren-string-syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With