You can generated a lazy loaded route in your app with a single command! 🔥
Lazy-loading would help you ship JavaScript associated with a particular route on demand, instead of slowing down the initial app load time.
Use below command to generate the lazy loading.
$ ng g module ranking --route ranking --module app.module
Generate RankingModule
Inside AppModule, generate lazy-route for the RankingModule
Generate RankingComponent and add its declaration in RankingModule
Generate eager route declaration with RankingComponent.
With the below command using CLI can create the angular component.
$ ng g c <component_name>