MatDialog错误:没有提供InjectionToken mat-dialog-scroll-strategy的提供程序 [英] MatDialog Error: No provider for InjectionToken mat-dialog-scroll-strategy

查看:70
本文介绍了MatDialog错误:没有提供InjectionToken mat-dialog-scroll-strategy的提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过在提供者中包括提供者:MatDialog

By including Provider: MatDialog in the Constructur

constructor(groupService: GroupService, public dialog: MatDialog) {}

运行时出现以下错误

错误:没有提供InjectionToken mat-dialog-scroll-strategy的提供程序!

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

我已将Matdialog包含在"app.module.ts"中 我需要其他提供商吗?我使用角材2.0.0b12

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

推荐答案

您需要在导入中包含MatDialog模块.

You need to include MatDialog Module in the imports.

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

这篇关于MatDialog错误:没有提供InjectionToken mat-dialog-scroll-strategy的提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆