使用VSCode时Angular2无法观看 [英] Angular2 cannot watch when using VSCode

查看:106
本文介绍了使用VSCode时Angular2无法观看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写Angular2应用程序,并在命令ng serve中使用angular-cli在本地主机上提供该应用程序.这样就可以构建应用并提供服务,并且监视更改代码.

I am writing an Angular2 app and use angular-cli with the command ng serve to serve the app on localhost. This builds the app and serves it and also watches the code for changes.

这很好,当我对代码进行任何更改并保存时,angular-cli会检测到更改并重建代码并刷新浏览器.

This works fine and when I make any changes to the code and save, angular-cli detects the changes and rebuilds the code and refreshes the browser.

这在我使用的除VSCode之外的任何编辑器中都能正常工作.在更改代码并将代码保存在VSCode中时,它将保存代码,但是,angular-cli无法检测到更改.我必须停止观看angular-cli并手动进行重建.

This works fine in about any editor I use except for VSCode. When making changes to the code and saving the code in VSCode, it saves the code, however, angular-cli does not detect the changes. I have to stop angular-cli from watching and manually do a rebuild.

我该如何解决?

推荐答案

在过去的6个月中,我一直在使用Angle 2和Angular 2开发VSCode. 但对我来说效果很好,可能是您在VSCode中安装了某些扩展程序导致了此问题

I am working on angular 2 and VSCode for last 6 months and using angular-cli. but it works fine for me, may be you have some extenstions installed in VSCode which is causing this issue

这篇关于使用VSCode时Angular2无法观看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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