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

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

问题描述

通过在构造器中包含提供者:MatDialog

By including Provider: MatDialog in the Constructur

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

我在运行时遇到以下错误

I get following error at runtime

错误:没有 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天全站免登陆