Angular CDK/Material tags showing as not a known element in VSCode with Angular Language Service

712 Views Asked by At

I'm seeing errors showing up in my HTML file where I use Angular CDK tags as shown in screenshot below in VSCode with Angular Language Service installed: enter image description here

I have imported the cdk module into my app module as well: enter image description here

Tried with Angular material as well and it's showing the same error without any intellisense suggestion. I'm able to run ng serve without any errors though. Anyone has any idea to resolve this? Thanks.

2

There are 2 best solutions below

1
antoineh On

Can you check if the TS version to the bottom right of your editor matches the TS version in your package.json file ? I had strange highlighting behaviors with outmatching TS version

0
YUNUS FİLLİK On

Use Legacy View Engine language service

Go to Angular Language Service extension settings and close View-engine