Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

179
Vistas
Regarding header footer in another module in angular

I am a new of Angular. I created header, footer and sidebar. And I was create dashboard component if I use in this dishoard component its works good. So it is working in component. then I created a module for employee. if i use Header Footer Sidebar in this employee module means its shows error

  1. If 'app-header' is an Angular component, then verify that it is part of this module.
  2. If 'app-header' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

1


src/app/employee/list-employee/list-employee.component.ts:5:16
  5   templateUrl: './list-employee.component.html',
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Error occurs in the template of component ListEmployeeComponent.


Error: src/app/employee/list-employee/list-employee.component.html:2:1 - error NG8001: 'app-sidebar' is not a known element:
1. If 'app-sidebar' is an Angular component, then verify that it is part of this module.
2. If 'app-sidebar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

2 <app-sidebar></app-sidebar>

src/app/employee/list-employee/list-employee.component.ts:5:16 5 templateUrl: './list-employee.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component ListEmployeeComponent.

Error: src/app/employee/list-employee/list-employee.component.html:514:9 - error NG8001: 'app-footer' is not a known element:

  1. If 'app-footer' is an Angular component, then verify that it is part of this module.
  2. If 'app-footer' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

514 ~~~~~~~~~~~~

src/app/employee/list-employee/list-employee.component.ts:5:16 5 templateUrl: './list-employee.component.html', ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error occurs in the template of component ListEmployeeComponent.

Please help me to sort out this error.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you put these components in a separate module, you can import it in all the other parts of your app that use the sidebar, header and footer.

@NgModule({
  declarations: [
    SidebarComponent,
    HeaderComponent,
    FooterComponent
  ],
  exports: [
    SidebarComponent,
    HeaderComponent,
    FooterComponent
  ]
})
export class LayoutModule { }

And in the employee module you can do something like this:

@NgModule({
  declarations: [
    // ...
  ],
  imports: [
    // ...
    LayoutModule,
  ],
})
export class EmployeeModule {}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda