简体   繁体   English

使用VSCode时Angular2无法观看

[英]Angular2 cannot watch when using VSCode

I am writing an Angular2 app and use angular-cli with the command ng serve to serve the app on localhost. 我正在编写Angular2应用程序,并将ng serve -cli与ng serve命令一起使用,以在localhost上提供该应用程序。 This builds the app and serves it and also watches the code for changes. 这样就可以构建应用程序并提供服务,还可以监视代码中的更改。

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. 这可以正常工作,当我对代码进行任何更改并保存时,angular-cli会检测到更改并重建代码并刷新浏览器。

This works fine in about any editor I use except for VSCode. 在我使用的除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. 在更改代码并将代码保存在VSCode中时,它将保存代码,但是,angular-cli无法检测到更改。 I have to stop angular-cli from watching and manually do a rebuild. 我必须停止观看angular-cli并手动进行重建。

How can I fix this ? 我怎样才能解决这个问题 ?

I am working on angular 2 and VSCode for last 6 months and using angular-cli. 我在过去6个月中一直在使用angular-cli和angular 2和VSCode进行开发。 but it works fine for me, may be you have some extenstions installed in VSCode which is causing this issue 但对我来说效果很好,可能是您在VSCode中安装了一些扩展程序导致了此问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM