When will Angular routes use loadChildren?

excuse me, when can I use loadChildren to route? On the Internet, it is said that the loading sub-module, in the project, what is the sub-module ah. How is this "sub-module" design specification defined?
do you have any examples for reference.?


when you want to delay loading a set of routes, consider using loadChildren. In fact, the main purpose of
is to lighten the load and improve the performance of angular.

for example, you define two routes

{ path: 'login', component: LoginPage },
{ path: 'user', loadChildren: './modules/user.module-sharpUserModule'},

one is the-sharplogin, static route, which loads the loginPage together when the route is initialized.
one is-sharpuser, dynamic routing, which uses loadChildren, to delay loading UserModule
for example, in your application, you never need to jump to-sharpuser, and the content under the UserModule does not need to be loaded at all.
especially if you have a lot of pages below your UserModule, the performance improvement will be significant.

and this UserModule is actually a module, of angular
you can put User-related components, services, and even the secondary routing configuration under the user into this UserModule.

as for the definition specification, it is to define an angular module. Just put the code you need into the corresponding data set.

@NgModule({
    declarations: [...],
    providers: [...],
    imports: [...]
    .....
});
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31f5d-2bdd1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31f5d-2bdd1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?