angular - 角度材质对话框导入问题
问题描述
早上好,
我想显示角度材料的对话框,但我对导入有问题,我不明白这个问题。
当然,我有一个角材料模块,我在其中导入了 matdialog,然后在 app.module 中导入了它
错误:错误错误:未捕获(承诺):错误:类型DialogFormComponent是2个模块声明的一部分:AppModule和ProduitsModule!
应用程序模块
import { DialogFormComponent } from './produits/dialog-form/dialog-form.component';
@NgModule({
declarations: [
AppComponent,
DialogFormComponent
],
entryComponents: [DialogFormComponent],
产品.ts
export class ProduitsComponent implements OnInit {
public productArray: Produit[] = [];
constructor(public dialog: MatDialog) { }
ngOnInit() {
}
openDialog() {
this.dialog.open(DialogFormComponent);
}
}
解决方案
我找到了解决方案,实际上我有一个 produits.module,其中声明了 dialogFormComponent 我现在删除了它,感谢您的帮助,一切正常
推荐阅读
- ansible - json 对象的 Ansible 过滤器
- google-apps-script - 根据数据自动创建工作表
- webix - Webix 控件本地化 Label Caption 阿拉伯语
- c++ - 从 C++ 中的链表中删除最后一个结束节点
- python - 在 python 中检查与 self 的相等性是什么意思?
- android - Android 应用程序链接 - 在浏览器中打开应用程序的 url 而不会触发应用程序链接
- python - 如何通过 Ajax 返回 Django 表单验证错误
- excel - 无法通过 VBA 脚本获取数据
- angular - 有没有像 Angular 8 或 reactjs 中的“removeClippedSubviews”这样的选项来优化 Web 组件的大量内容?
- c# - 无法通过 LoadSceneAsync 加载 EasyAr 场景