Angular Material and Jasmine : “ No provider for InjectionToken MdDialogData! ”

前端 未结 6 2030
醉梦人生
醉梦人生 2021-02-01 12:12

I have a component which is meant to be used in an Angular Material MdDialog :

@Component({
  ...
})
export class MyComponent {

  constructor(@Inject(MD_DIALOG_         


        
6条回答
  •  醉梦人生
    2021-02-01 12:29

    as an update, this is also replicated for those who use the tags with the prefix "Mat"

    providers: [{provide: MAT_DIALOG_DATA, useValue: {}}, 
    {provide: MatDialogRef, useValue: {}}]
    

提交回复
热议问题