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

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

问题描述

我正在使用 angular 10 和 angular material 10.角度材质对话在生产版本(ng serve --prodng build --prod)中不起作用,但它在本地开发环境(ng 服务)

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. 我已经在entryComponentsbootstrap
  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天全站免登陆