Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!