ng服务一次后,如何防止自动重新加载页面? [英] How do I prevent auto reload page when ng serve for one time?

查看:103
本文介绍了ng服务一次后,如何防止自动重新加载页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,我在Chrome中进行了少量的CSS草图更新,所以这正是我需要的更新.然后我将它们添加到css文件中.在这一步,我必须保存css文件.但是保存后,我在Chrome中丢失了草图更新.如果我在css文件中正确进行了所有更改,则可以.但是,如果我打印不正确或忘记复制某些CSS样式,则必须检查我做错了什么,因为我无法检查Chrome中的草图更新.

Sometimes I make few css sketch updates in Chrome, see that it is exactly the updates I need. Then I add them to css file. And at this step, I have to save the css file. But after saving I lose my sketch updates in Chrome. It's ok if I make all changes in css file correctly. But in case I did some misprint or forget to copy some css style I have to check what did I wrong because I can't check with sketch updates in Chrome.

当ng服务一次时,如何防止自动重新加载页面?

How do I prevent auto reload page when ng serve for one time?

推荐答案

使用以下命令启动开发服务器:

Start your dev server with:

ng serve --live-reload false

此处的文档: https://github.com/angular/angular-cli/wiki/服务

如果这不起作用,请执行以下操作:

If that doesn't work then do:

ng serve --live-reload=false

您可以同时运行两个开发服务器,如下所示:

You could run two dev servers at same time as follows:

ng serve // with live reload on port 4200

ng serve --live-reload=false --port=4300 // without live reload on port 4300

这些可以同时运行.

这篇关于ng服务一次后,如何防止自动重新加载页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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