how to fix "attribute is not allowed here" on angular project

2

Looks like WebStorm has failed to find definitions of the corresponding directives/attributes. Where do they come from?

0
Avatar
Permanently deleted user

they from node_modules, Visual studio code work with plugins

here is demo repo:

https://github.com/cipchk/ng-alain

 

the file of problems:

src/app/routes/dashboard/v1/v1.component.html

 

and thank you for your replay :-D

0

Doesn't work for me in VSCode as well... Logged as https://youtrack.jetbrains.com/issue/WEB-32129, please follow it for updates

0
Avatar
Permanently deleted user

im using this plugins for vscode, you can try it
- Angular v4 TypeScript Snippets
- Auto Import
- TypeScript Import Assistance
- AngularDoc for Visual Studio Code

and think you for help again

0

Was there ever a solution to this? I'm still running into this on the latest version of PHPStorm.

0

Try to enable "Angular and AngularJS" plugin.
[Ctrl] + [Alt] + [S] >> Plugins >> Marketplace >> 'Angular' >> Install and Enable

0

My issue was solved by removing node_modules / package-lock.json / Invalidating all caches / npm install and reloading everything from disk. Somehow an update has not been well processed by IntelliJ.

0

Please help me. My ide not indexing angular and angilar-material, not work intelicence in template

my Application work fine, and all modules includes, and I am check library - angular and other excluded

ide fine work with angular 11, may be it is trobble only 12 angular

0

@Gordondalos

What is your IDE version / show About screen?

0

We aren't aware of such issues with the latest Webstorm (2021.2.1)

Can you repeat it in a new Angular app?

0

update webstorm to latest version fix my problem

1

I have the last version of Webstorm but this issue is not fixed.

0

ABELARDO What Angular version do you use?

0

Same issue here with WebStorm 2021.2.3 and Angular version 13.0.0

1

Angular 13 will be supported in this week's EAP release. Here is the main issue - WEB-53312.

2

As it's mentioned above, Angular 13 will be supported in the next 2021.3 EAP

0

This problem still happening for me with IntelliJ 2022.1.4 Ultimate, with Angular 12.2 and Angular plugin enabled.

2

Still happening for me aswell.

I'm on Webstorm 2022.3.2, and angular 14.1.3

Even though, it perfectly finds the dynamic parameters

0

Nicki Skipper do you have a sample project you can share that reproduces the issue?

1

Hmm, i could make one.

0
thank you, would be helpful
0

Thanks for asking me about that Elena Pogorelova

Ok, i more or less found out what is wrong, after some trial and error.
It's all about having parameters as enums. 

You can test it here: https://github.com/captainDuckay/angular-parameter-error

As you see, the testTypeEnum is not valid, until it is called as a dynamic parameter.

Thanks for looking into it. We have a lot of components that are "typed" in the template file, and not in a "static" property.

0

Thank you!
You get the error because types don't match. Without the [..] you are not using Angular typed binding but just "regular" string-only binding, and the component property testTypeEnum:string is unknown.
You will face issues when building your app, like TS2322: Type '"a"' is not assignable to type 'TestTypeEnum'.

0

Thanks for the reply Elena Pogorelova

I'll keep that in mind going forward. It's probably just the IDE being strict, while the runtime code doesn't 
Even if IDE reports back a bug like the one we described, the binding still goes through, and it will understand the 'a' or 'b' parameter. But that might just be the behaviour of typescript not being "strict", when the output ends up being the same, using a enum, or just the value directly as a "regular" string.

0

With the default Angular setup, with the strict template checking enabled, you will face issues in runtime as well

0

请先登录再写评论。