As a newcomer to Angular, I encountered an issue when trying to integrate '' into my customers.component.html file:
- If 'app-customers-list' is supposed to be an Angular component, ensure that it is included in this module.
- If 'app-customers-list' is a Web Component, make sure to add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component [...]
Although this error is quite common, I'm struggling to identify what is causing it. It seems like there may be an issue with importing the customer-list component into my customers.module.
Let's take a look at my files:
customers.module.ts:
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { CustomersComponent } from './customers.component'; import { CustomersListComponent } from './customers-list/customers-list.component'; @NgModule({ imports: [ CommonModule ], declarations: [ CustomersComponent, CustomersListComponent ], exports: [ CustomersComponent,CustomersListComponent ] }) export class CustomersModule { }
customer.list.component.ts:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-customers-list',
templateUrl: './customers-list.component.html'
})
export class CustomersListComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}