Angular Material in Ionic 6

I’m trying to use angular material in ionic 6, but when I do the command ng add @angular/material, don’t work.
Why? How can i make it work?

Hi @frame88,

I have figured it out. You must explicitly install @angular/animations first (I have used version @14.2.10). Then you can install @angular/material with version @14.2.7.

If you don’t install @angular/animations it said:

npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"15.1.2" from @angular/animations@15.1.2
npm ERR! node_modules/@angular/animations
npm ERR!   peer @angular/animations@"^14.0.0 || ^15.0.0" from @angular/material@14.2.7

Don’t know why it referenced @angular/core with version @15.1.2

I hope this helps.