Introduction
In this article, I am going to explain how to check the flow of lazy loading in Angular application using the Augury Google Chrome extension. When I was implementing lazy loading in my project, I faced some difficulty checking which module is lazy loaded. I came to know about Augury extension, which shows the flow of lazy loading of all modules through the diagram. By seeing visually that our work is half done, if any modules are left behind in code, then we can easily check their routing in the route tree of Augury.
Let's start with a common question:
What is Augury?
Augury is a developer tool extension for debugging Angular applications inside Google Chrome browsers.
Installing Augury
You can install Augury from chrome web store or simply type in google "Augury" into the search field, and then press Enter.
https://chrome.google.com/webstore/category/extensions


For Windows and Linux, use Ctrl + Shift + I
For Mac OS X, use Cmd + Opt + I
Steps To Install Angular
Prerequisites
- Basic knowledge of Angular
- Visual Studio Code must be installed
- Angular CLI must be installed
- Node JS must be installed
Step 1
Let's create an Angular project using the following npm command
- ng new AuguryDemo
First, open this project in VS Code and install bootstrap by using the following command,
- npm install bootstrap --save
Now open styles.css file and add Bootstrap file reference. To add a reference in styles.css file, add this line,
- @import '~bootstrap/dist/css/bootstrap.min.css';
Now create two modules named,
Companies
- ng g m Companies --routing
Product
- ng g m product --routing
Now create some demo components in both of these modules by using given commands.
For Companies,
- ng g c company1
- ng g c company2
Now open companies-routing.module.ts file and add the following code inside this file,
- import { NgModule } from '@angular/core';
- import { Routes, RouterModule } from '@angular/router';
- import { Compnay1Component } from './compnay1/compnay1.component';
- import { Compnay2Component } from './compnay2/compnay2.component';
- import { CompnayComponent } from './compnay.component';
- const routes: Routes = [
- {
- path:'Compnay1',component:Compnay1Component
- },
- {
- path:'Compnay2',component:Compnay2Component
- },
- {
- path:'Compnay',component:CompnayComponent
- }
- ];
- @NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
- })
- export class CompaniesRoutingModule { }
Now create some demo components in both this modules by using given commmands.
For Product:
- ng g c product1
- ng g c product2
Now open 'Product-routing.module.ts file' and add the following code inside this file:
- import { NgModule } from '@angular/core';
- import { Routes, RouterModule } from '@angular/router';
- import { Product1Component } from './product1/product1.component';
- import { Product2Component } from './product2/product2.component';
- import { ProductComponent } from './product.component';
- const routes: Routes = [
- {path:'Product1',component:Product1Component},
- {path:'Product2',component:Product2Component},
- {path:'prod',component:ProductComponent},
- ];
- @NgModule({
- imports: [RouterModule.forChild(routes)],
- exports: [RouterModule]
- })
- export class ProductRoutingModule { }




Sourav Kumar DasPosted Dec 26, 2019, 12:56 AM
Nice and useful article. Thanks for sharing.
Ankur MistryPosted Dec 23, 2019, 10:04 PM
Thank you for sharing, useful stuff