Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

148
Visualizações
angular JavaScript not working in children component, javascript file not loaded

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 routing modules

i am new in angular, i am using angular 14v

i have a component name with "home"

i used two routing

  1. app-routing.module.ts
  2. admin-routing.module.ts

This goes inside app-routing.module.ts

const routes: Routes =
  [
    { path: 'login', component: LoginComponent },
    { path: 'forgot-password', component: ForgotPasswordComponent },
    { path: 'not-found', component: NotFoundComponent },
    { path: '', redirectTo: 'login', pathMatch: 'full' },
    {
      path: 'admin',
      loadChildren: () =>
        import('./modules/admin/admin.module').then((m) => m.AdminModule)
    },
    {path:'home', component:HomeComponent},
    { path: '**', component: NotFoundComponent },
    
  ];

This goes inside admin-routing.module.ts

const routes: Routes = [
  {
    path: '',
    component: HomeComponent,
    children: [
      { path: '', redirectTo: 'dashboard', pathMatch: 'full'},
      { path: 'dashboard', component: DashboardComponent }
    ]
  }
];

i also added the script file path in angular.json

the navigation dropdown and toogle is not working in admin-routing.module.ts's "home path"

i hosted these files in my server

working navigation link is http://angular.byteinnovations.in/home

this navigation is not working http://angular.byteinnovations.in/admin/home

about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda