MatDialog Error: No provider for InjectionToken mat-dialog-scroll-strategy

孤人 提交于 2019-12-08 19:21:14

问题


at including Provider: MatDialog in the Constructur

      constructor(groupService: GroupService, public dialog: MatDialog) 

I get following error at runtime

     Error: No provider for InjectionToken mat-dialog-scroll-strategy!

I have included the Matdialog in the "app.module.ts" Do i need a different Provider for it and which one? I use angular-material 2.0.0b12

thanks


回答1:


You need to include MatDialog Module in the imports.

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


来源:https://stackoverflow.com/questions/46706533/matdialog-error-no-provider-for-injectiontoken-mat-dialog-scroll-strategy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!