Questions tagged [angular-lazyloading]

83 questions
0
votes
0 answers

Angular 11 Only 1 library in Lazy chunk files when ng build

I have a two libraries that are built into node_modules directory. I use libray1 in library2 and use both in app-routing.module.ts to lazy load routes in both libraries. When I ng build the main app, It shows only library2 under Lazy chunk…
Dogukan Evcil
  • 313
  • 4
  • 15
0
votes
0 answers

Crazy modules behaviour in Angular 11

I created some components that use other components. All components works fine except the last I created. This is the code in HTML: This is the module of my new component: @NgModule({ imports: [ …
erikscandola
  • 2,854
  • 2
  • 17
  • 24
0
votes
2 answers

How to redirect to dashboard when you have lazy loaded modules with empty paths in Angular?

I have a problem with the routing in Angular 9. This is the app routing module: const routes: Routes = [ { path: '', loadChildren: () => HomeModule, canActivate: [AuthGuard] }, { path: 'login', component: LoginComponent }, { path:…
0
votes
0 answers

Reduce the size of Angular 7 app's NGRX store

I have an angular 7 application which uses NGRX store. The application has 20 modules with Search page & CRUD pages. The modules are lazy-loaded. The NGRX state holds the data that is displayed/entered in the page. As the user visits multiple pages…
GokuSS3
  • 123
  • 1
  • 11
0
votes
2 answers

How we can fetch route parameters in lazily loaded module in Angular

I have route like below, where am passing id as parameters. So the same ID I have to use inside the module for loading isolated translation file on a basis of route parameters. const routes: Routes = [ { path: 'flight/:id', loadChildren: () =>…
Gajanan Kolpuke
  • 155
  • 1
  • 1
  • 14
0
votes
0 answers

Unable to lazy load feature module in Angular

I'm following the documentation on lazy loading and I get the following error on an Angular 10 project ERROR in src/app/modules/app-routing.module.ts:21:52 - error TS2339: Property 'MergeModule' does not exist on type 'typeof…
0
votes
0 answers

Lazy Loading BrowserModule has already been loaded while importing NgClockPickerLibModule in lazy loaded module

Importing NgClockPickerLib Module in Lazy loaded module which is creating error : Error: Uncaught (in promise): Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module,…
0
votes
2 answers

How to properly structure angular app with multiple modules that can access one another?

I am still getting used to Angular and how to properly structure different components and modules. I want to set my app up according to best practices and maximize efficiency. I currently have multiple modules. I have a "base" module that I want to…
ts1993
  • 107
  • 2
  • 12
0
votes
1 answer

In Angular dynamic route name not working when navigateByUrl(), its need to refresh the page

This is my main route file let baseRoute= Config.loginFirstName==null ? 'abcd':Config.loginFirstName; const routes: Routes = [ {path: '', redirectTo: '/'+baseRoute+'/'+Config.role+'/dashboard/home', pathMatch: 'full' }, {path:'help',…
Umashankar Saw
  • 1,131
  • 1
  • 9
  • 25
0
votes
0 answers

Cannot trigger resolver in Angular 5 using lazy loading modules

I am trying to rewrite Angular5 app into lazy loaded modules, but cannot identify why resolvers are not triggered. Modules are loaded properly, but resolver never. I have tried multiple different components and always facing the same issue. How…
jokuja
  • 89
  • 1
  • 15
0
votes
2 answers

Angular 9 - Cannot deactivate router outlet on lazy loaded module

Baiscally I have a component which needs to be displayed conditionally upon the activation/deactivation of a named router-outlet. All right on the activation side, but it doesn't work when the url changes back (i.e. someone presses the browser's…
0
votes
1 answer

'mat-card-content' is not a known element:

I get this error with Angular Universal, lazy loading and share module of material. When I run npm run dev:ssr I get this error I think that is combination of lazy loading and Angular Universal. 'mat-card-content' is not a known element import {…
Rams
  • 1
  • 1
  • 2
0
votes
1 answer

Angular Routing Issues ( Router Not registering clicks)

I am stuck and would be thankful for your help. I am new to Angular and using the Lazy loading approach to load modules. I have a master Module with a routing module that holds all the children routing with it. as follows --- Main Routing …
anil
  • 11
  • 1
0
votes
0 answers

Lazyloaded component and routing

I have a lazyloaded module called A. I load A when navigating to 'a/comp1/:data1'. In order to achieve it I declared in my app.module a route like this: Path:'a', loadChildren: () => import('./a/a.module').then(m => m.aModule) In the A module I…
IsraGab
  • 4,819
  • 3
  • 27
  • 46
0
votes
0 answers

does importing unwanted feature modules in angular modules increases size or affects performance

I have got multiple features/components which are being used in different Angular modules.. currently loading them all separately Module 1: Feature 1 Feature 2 Feature 3 Feature 4 Module 2: Feature 3 Feature 5 Module 3: Feature 1 …
Shubham Shaw
  • 841
  • 1
  • 11
  • 24