角材料对话框在生产版本中不起作用 [英] The angular material dialog is not working in production build

查看:70
本文介绍了角材料对话框在生产版本中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用角度10和角度材料10.角材料对话在生产版本中不起作用( ng serve --prod ng build --prod ),但在本地开发环境中运行良好(ng serve )

I am using angular 10 and angular material 10. the angular material dialogue is not working in the production build (ng serve --prod and ng build --prod) but It is working fine local dev environment (ng serve)

  1. 我已经在 entryComponents bootstrap
  2. 中添加了该组件
  3. 在控制台中没有引发任何类型的错误.我看到的是卡已加载,对话框中没有可用的组件,
  4. 您可以看到下面的屏幕快照,该屏幕快照正在加载卡,但其中没有加载任何组件.

推荐答案

经过大量研究,我发现问题出在IVY引擎上.对于某些人来说,更改以下内容可以解决问题.
tsconfig.json

After a lot of research I found, the problem is with the IVY engine. For some people changing the below can solve the problem.
tsconfig.json

"angularCompilerOptions": {
    "enableIvy": true
  },

如果要使用Ivy引擎.如果将Angular 10项目更新为Angular 11,该问题将得到解决.

If you want to use the Ivy engine. the problem will be resolved if you update the Angular 10 project to Angular 11.

这篇关于角材料对话框在生产版本中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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