Questions tagged [angular-lazyloading]

83 questions
5
votes
3 answers

Angular 9 hybrid with ui router causes Trying to get the AngularJS injector before it being set. How to debug/fix?

[EDIT] I've created a demo repository with this error: https://github.com/SamanthaAdrichem/hybrid-lazy-load-angularjs-injector-error We've followed the instructions, and all runs fine on normal hybrid, but adding lazy loading fails with the strange…
4
votes
1 answer

Angular 12 - Lazy loading path module does'nt work

I have a jobs module which contains various components of my application. I want to do a lazy load of said module, however, it does not work when I try to access through the full path, that is, if I access through the path…
scafrs
  • 443
  • 8
  • 20
4
votes
1 answer

Angular 9 - lazy loading is not working in production build

I am working on one of the application on Angular 9 and implemented the lazy loading for some module. configuration are below: package.json:`"dependencies": { "@agm/core": "^1.1.0", "@angular/animations": "~9.1.0", "@angular/common":…
3
votes
0 answers

Images do not appear using lazyload

I have an image gallery and I intend to load the images slowly as the scroll is made. For that, I execute a function that sends the image path and in return I receive the image in base64. I tried to simulate in the stackblitz, but the images do not…
3
votes
3 answers

Angular lazy load with named outlet not working

I created a products folder which contains products-home.component(parent) and products-list.component(child) with named outlet. I get Error: Cannot match any routes. URL Segment: 'products' when navigated to products-list using lazy load. This is…
Sameer
  • 4,758
  • 3
  • 20
  • 41
2
votes
1 answer

Angular dynamic lazy loading of components

Problem I have an Angular application where components are registered under a certain name to a global map using decorators. This name can then be used to dynamically create a route for this component (at runtime). E.g. a component is registered…
2
votes
2 answers

Angular routing: Conditional route with library import

TL;DR How can I have a conditional route with conditional import of the corresponding Angular library during build time, depending on a feature flag in the environment file? Background I'm having a route configuration that lazy loads an Angular…
2
votes
0 answers

Cannot guard lazy loaded module in Angular

I'm trying to have an auth guard on every page of my Angular app. I can't get this to work for lazily loaded modules using the import() syntax. My lazy feature module: const routes: Routes = [ {path: '', component:…
2
votes
1 answer

My app's RouterModule isn't lazy loading posts

I am learning Angular and as a practice project, I am developing a front-end interface (with angular 13) for a Wordpress API served from a Docker container. The angular app has to display the list of all posts obtained from the API and by making use…
2
votes
0 answers

Angular Router - Data missing within lazy loaded modules

I have a module with the routes defined something like below. const routes: Routes = [ { path: '', pathMatch: 'full', component: RoleListViewComponent }, { path: RolesRoutes.addNewRole, component: ManageRoleComponent, …
2
votes
1 answer

how to share same service instance between 2 lazy loaded modules - not at root

Is it possible to share the same instance for a service, between two lazy loaded modules, where that service is not provided at the root injector? Or at least, not provided until called upon? E.g. I have LazyModuleA and LazyModuleB that are, as…
skwny
  • 2,930
  • 4
  • 25
  • 45
2
votes
1 answer

Does importing a component from a lazy loaded module elsewhere in the app circumvent lazy loading of this module in Angular 12?

We have some modules that come with their own navigation bars. These nav bars are actual components and they activated in the global HeaderComponent of the app as soon as the corresponding route is activated. To pass the navigation component we use…
2
votes
2 answers

Angular - Using the same module for multiple paths

A bit of a code structure question for Angular. I’m trying to achieve a split screen design, where the left and right show different data, based on different queries. The left will usually dictate which data on the right is display. For example: The…
Que
  • 957
  • 2
  • 14
  • 35
2
votes
1 answer

Angular Lazy loading: loadChildren different behaviours

Guys i have an angular application with lazy loading enabled and below modules. CoreModule, (import in app module) SharedModule, (imported in each module) ProjectsModule, AuthModule And this is my app routing module: { path: "", …
2
votes
2 answers

Angular 8 update breaks lazy loading of modules

I have an app that was originally developed with Angular 6 and has been running fine in production for over two years. This week I started incrementally updating it to the most recent stable version using the Angular Update Guides. Moving from 6 to…
ChiefTwoPencils
  • 13,548
  • 8
  • 49
  • 75
1
2 3 4 5 6