0

I'm using lazy loading in Angular Router. When I click on a menu item and the component is loading, I want to show a loading indicator and hide it when the component loaded completely. How can this be done?

const routes: Routes = [
  {
    path:'',
    redirectTo:'/home',
    pathMatch: 'full'
  },
  {
    path: 'home',
    component: HomeComponent
  },
  {
    path: 'site-feedback',
    loadChildren: "src/app/views/site-feedback/site- 
     feedback.module#SiteFeedbackModule"
  }
]

1 Answer 1

1

You can achieve this using different concepts like 1. Interceptor 2. Resolver 3. NGRX store

Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.