如何启用生产模式? [英] How to enable production mode?
问题描述
我正在阅读相关问题,发现 ,但是我的问题是如何从开发模式切换到生产模式.在此处指出的模式之间存在一些差异.
I was reading related questions and I found this one, but my question is how can I switch from development to production mode. There are some differences between the modes which are pointed out here.
在控制台中,我可以看到....Call enableProdMode() to enable the production mode.
.但是,我不确定应该在哪种类型的实例上调用该方法.
In the console I can see ....Call enableProdMode() to enable the production mode.
However, I'm not sure instance of which type should I call that method on.
有人可以回答这个问题吗?
Can somebody answer this question?
推荐答案
您可以通过导入并执行该功能(在调用引导程序之前)来启用它:
You enable it by importing and executing the function (before calling bootstrap):
import {enableProdMode} from '@angular/core';
enableProdMode();
bootstrap(....);
但是此错误表明绑定有问题,因此您不应该只是取消它,而要弄清楚它为什么会发生.
But this error is indicator that something is wrong with your bindings, so you shouldn't just dismiss it, but try to figure out why it's happening.
这篇关于如何启用生产模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!