Angular compile error on missing dependencies

Viewed 3988

I added button but after compiling I faced this issue, let me know how to add this dependencies:

ERROR in The target entry-point "@angular/material/button" has missing dependencies:
- @angular/core
- @angular/cdk/a11y
- @angular/platform-browser/animations
- @angular/cdk/coercion

2 Answers

Try to add "MatButtonModule" to your app.module.ts or maybe your material.module.ts. Depends on the way you have setted it up.

Be sure it is part of your imports and exports:

import { MatButtonModule } from '@angular/material';
@NgModule({
  imports: [MatButtonModule],
  exports: [MatButtonModule]
})

Try npm install --save @angular/material @angular/cdk If you just installed @angular/material it possibly won't work.

Related