Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attribute [ngSwitch] is not allowed here, this is what IntelliJ IDEA 2016 tells me for an Angular2 template, why?

Everything seems to work fine, I have intellisense and such. However, when I run precommit inspections I have tons of warnings, like:

Warning:(8, 58) Attribute [ngSwitch] is not allowed here
Warning:(9, 42) Attribute [attr.for] is not allowed here
Warning:(10, 14) Attribute *ngSwitchCase is not allowed here
Warning:(11, 32) Attribute *ngFor is not allowed here
Warning:(12, 38) Attribute [attr.for] is not allowed here
...

And so forth and so forth.

How do I instruct the IDEA that these are fine? I do not want to disable the inspection blindly, but not sure if there is a way to avoid it.

EDIT 1

I have AngularJS plugin already installed: enter image description here

like image 888
mark Avatar asked Aug 18 '16 22:08

mark


1 Answers

I've had this problem on and off over the past few months. I even posted an issue with Jetbrains and the thread seems to have received much attention since.

I just resolved the problem by removing my .idea directory for the project and re-opening the IDE.

like image 123
Stephen Paul Avatar answered Nov 11 '22 16:11

Stephen Paul