Hello, I would like to ask a Lazy-loading question:
app.module.ts
import { DatePickerStartComponent } from './PageMaterial/date-picker-start/date-picker-start.component';
import { CommonModule } from '@angular/common';
@NgModule({
declarations: [
DatePickerStartComponent,
CommonModule,
......and other Component other Module
app-routing.module.ts
{
path: 'AIMS',
loadChildren: () => import('./aims/aims.module').then(m => m.AIMSModule)
},
aims.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
@NgModule({
declarations: [
],
imports: [
CommonModule,
AIMSRoutingModule,
AIMSModule's component
aug-raw-avg.component.html
<app-date-picker-start class=" button-container btn-group col-12 col-xl-6" (dateSelected)="handleDateSelected($event)"></app-date-picker-start>
has a problem:
'app-date-picker-start' is not a known element:
- If 'app-date-picker-start' is an Angular component, then verify that it is part of this module.
- If 'app-date-picker-start' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.ngtsc(-998001)
aug-raw-avg.component.ts(1, 144): Error occurs in the template of component AugRawAvgComponent.
(element) app-date-picker-start: HTMLElement