I am using lazy loading in ionic 3.6.1 and got follow error. Any idea what is the issue?
'menu-list' is not a known element:
1. If 'menu-list' is an Angular component, then verify that it is part of this module.
2. If 'menu-list' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
home.html
<menu-list></menu-list>
home.module.ts
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { HomePage } from './home';
import { MenuListComponent } from "../../components/menu-list/menu-list";
@NgModule({
declarations: [
HomePage,
],
imports: [
IonicPageModule.forChild(HomePage),
MenuListComponent
],
})
export class HomePageModule {}
menu-list.ts
import { Component } from '@angular/core';
@Component({
selector: 'menu-list',
templateUrl: 'menu-list.html'
})
export class MenuListComponent {
text: string;
constructor() {
console.log('Hello MenuListComponent Component');
this.text = 'Hello World';
}
}
components.module.ts (generated, no modified)
import { NgModule } from '@angular/core';
import { MenuListComponent } from './menu-list/menu-list';
@NgModule({
declarations: [MenuListComponent],
imports: [],
exports: [MenuListComponent]
})
export class ComponentsModule {}
home.module.ts
moveMenuListComponent
fromimports
todeclarations
- Duannx