Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular: Component X is not included in a module and will not be available inside a template

In my Angular application, I have few components which are used while testing and not included in any module.

In WebStorm, it shows me a lint error saying Component is not included in any module, while I know that this is not included and that is the purpose.

Is there a way to disable only this lint error while keeping all others enabled?

Angular: Component 'ComponentName' is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration.

I saw this threat, where it was suggested to disable all Angular lint errors. However, i think it is not a good idea to do that just for one issue. I am looking for a way to only disable this one error.

like image 374
Aniruddha Das Avatar asked Nov 16 '17 19:11

Aniruddha Das


3 Answers

Worked for me:

File -> Invalidate Caches / Restart -> Invalidate and restart

like image 146
Filip Kubala Avatar answered Nov 06 '22 09:11

Filip Kubala


I use PHPStorm and found this problem also when using Angular 4. I fixed it by npm install @angular/language-service.

like image 26
Khachornchit Songsaen Avatar answered Nov 06 '22 09:11

Khachornchit Songsaen


Angular language service doesn't provide a possibility to suppress particular rules/checks. Please follow https://github.com/angular/angular/issues/13726 for updates

like image 3
lena Avatar answered Nov 06 '22 09:11

lena