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

查看:28
本文介绍了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?

推荐答案

启动你的开发服务器:

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天全站免登陆