W
W
waltaki2019-10-02 10:38:21
Angular
waltaki, 2019-10-02 10:38:21

Angular - How to load a module on demand?

Hello.
app.module.ts

{
    path: "admin",
    canActivate: [AuthorizedGuard, AdminOnlyGuard],
    loadChildren: "./module/admin.module#AdminModule"
  }

I have a page whose bundle is lazy loaded when a person clicks on it.
But let's say I'm already an admin and I want the bundle to load as soon as it's clear that I'm an admin.
How to implement this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question