I'm facing an issue with my Angular application where the compiler is throwing errors during the build process. Here's a snippet of the error messages I'm encountering:
ERROR in src/app/list-items/list-items.component.ts:9:14 -
error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
Is it missing an @NgModule annotation?
9 export class ListItemsComponent implements OnInit {
~~~~~~~~~~~~~~~~~~
src/app/not-found/not-found.component.ts:8:14 - error NG6002: Appears in the NgModule.imports of AppModule, but could
not be resolved to an NgModule class.
Is it missing an @NgModule annotation?
8 export class NotFoundComponent implements OnInit {
~~~~~~~~~~~~~~~~~
Below is the content of my list-items.component.ts
file:
import { Component, OnInit, NgModule } from '@angular/core';
@Component({
selector: 'app-list-items',
templateUrl: './list-items.component.html',
styleUrls: ['./list-items.component.css']
})
export class ListItemsComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
And this is how my not-found.component.ts
file looks like:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-not-found',
templateUrl: './not-found.component.html',
styleUrls: ['./not-found.component.css']
})
export class NotFoundComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
Finally, here is my app.module.ts
file which defines all the necessary modules and components for the application:
If anyone can shed some light on why the compiler is pointing out issues related to NgModule
, it would be greatly appreciated.