Questions tagged [angular-load-children]

16 questions
2
votes
1 answer

Parent component not hides in Angular router

I have an appComponent in which i display a toolbar, footer and the main content. This main content uses the router-outlet directive. It's something like this
Atlas91
  • 5,754
  • 17
  • 69
  • 141
2
votes
2 answers

loadChildren is deprecated in angular8

I just noticed that Angular 8 (which will be released soon), has deprecated "string-typed router loadChildren". (ticket) Do I understand correctly that they are refering to ... const routes = [ { path: 'production', loadChildren:…
bvdb
  • 22,839
  • 10
  • 110
  • 123
1
vote
0 answers

For Angular 8 - cannot loadChildren of type function via NgModuleFactoryLoader.load(path: string)

I have upgraded from Angular 7 to Angular 8 and I have changed the type of loadChildren from String to Function: export interface DynamicComponentManifest { componentId: string; path: string; loadChildren: Function; } And now when I am trying to…
1
vote
2 answers

What is difference between `loadChildren: () => import('./hoge.module.ts).then(m => m.HogeModule)' and loadChildren: './hoge.module#HogeModule'?

Issue We get an error cannot find module in case following structure. app-routing.module.ts const routes: Routes = [ { path: CHILD_MANAGEMENT_PORTAL.baseUrl, canActivate: [AuthGuard], component: EnvelopeComponent, loadChildren:…
1
vote
3 answers

How to properly lazyload component in angular?

I am stuck with some simple route management in Angular : I have this first module : import { NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { RouterModule } from '@angular/router'; import { LayoutComponent } from…
juanou
  • 43
  • 1
  • 5
1
vote
1 answer

Getting Error while "ng serve" Cannot read property 'loadChildren' of undefined

I am working on my project i wanna to lazy load my modules,and it's working fine but while i am "ng serve" m code i am getting this error "Cannot read property 'loadChildren' of undefined" Here is my app routing module export const appRoutes:…
0
votes
0 answers

Dynamically loadChildren in Angular based on service value condition

Is possible to loadChildren routes in Angular based on a service based value condition? I have the following route to be loaded: const routesFactory = (service: InjectedService) => { return [ { path: "", runGuardsAndResolvers:…
0
votes
2 answers

Cannot do ng for loop binding in angular 13

I would like to do an angular 13 looping to split data to one column when duplicate entries came from database now I got like this I Want like this
 
0
votes
1 answer

angular JavaScript not working in children component, left side nav dropdown is not working

i have a left side navigation in home component, the navigation dropdown is not working in one of the routing module (admin-routing.module.ts). the navigation is working in app-routing.module.ts "path:'home'" the component file is same in the two…
0
votes
1 answer

Angular 7: some confusion/strange behavior when using loadChildren in routing

I'm using loadChlidren in application, but I have some confusion/strange behavior that I didn't understand why happend. I have this app-routing-module.ts const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, …
0
votes
2 answers

Module Lazy Loading with the Angular Router

Helo programmers I tried apply lesson from youtube about project Facebook by anguler but I face problem when I write code : { path: '', loadChildren: () => import('./components/home/home.module').then(m :{HomeModule:HomeModule} =>…
0
votes
1 answer

Routing doesn't work correctly when user is authentication

So, I have a problem in a project with routing. I follow this steps. When Logon in system I save token and username in local storage. Login success, open dashboard page. I close browser and open again project. Page routing in Login page , no in…
A. B
  • 327
  • 4
  • 14
  • 33
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
2 answers

child route configuration with Angular 8

I have an app with angular 8 in which a have created two module: testModule and SimulatorModule the simulator is having a routing file but the testModule doesn't. I want to load all the component in the Simulator as children of the TestComponent…
0
votes
1 answer

an error message is displays while running the app.how can i fix

Error: Invalid configuration of route ''. One of the following must be provided: component, redirectTo, children or loadChildren In app.module.ts, RouterModule.forRoot([ { path:'', …
user12359058
1
2