J-R Choiniere
J-R Choiniere

Reputation: 694

Angular Material intellisense doesn't work in VSCode

I'm working on an Angular (v13) project and I installed Angular Material using this command

ng add @angular/material

I can see the package in the node_modules, but in VSCode, the intellisense/auto-import don't work at all for a typescript file, but it works with any other package.

It's not the first time I'm having this issue with Angular Material, but I never found a solution.

enter image description here

enter image description here

Upvotes: 3

Views: 3499

Answers (3)

Rikku121
Rikku121

Reputation: 2642

I ran into the same issue just now on V13. Adding the following line to tsconfig.json fixed it for me (goes under "compilerOptions"):

"typeRoots": ["node_modules/@angular/material"]

VSCode Intellisense MAterial

Upvotes: 17

J-R Choiniere
J-R Choiniere

Reputation: 694

ok I've found the issue. To have the intellisense working, I had to import the material module in my angular module, then I can see the intellisense in the component code.

enter image description here

Upvotes: 2

Apurwa Anand
Apurwa Anand

Reputation: 1

Not sure if this will help, but you can try using an extension like (Angular Language Service) available here https://marketplace.visualstudio.com/items?itemName=Angular.ng-template

Upvotes: 0

Related Questions