简体   繁体   English

在VS2017上运行Angular6项目

[英]Running an Angular6 project on VS2017

I have created an angular 6 project by first creating a "Console Node js App", and then importing the result of a "ng create ...". 我先创建了一个“ Console Node js App”,然后导入了“ ng create ...”的结果,从而创建了一个angular 6项目。

The project builds fine, but i can't figure out how to run it, that is, how to run the command "ng serve" from a Ctrl-F5 on VS2017. 该项目构建良好,但我不知道如何运行它,也就是说,如何在VS2017上从Ctrl-F5运行命令“ ng serve”。 Is that possible? 那可能吗? Can I run a bat/exe along with the "Start Without Debugging (Ctrl-F5)"? 我可以同时运行bat / exe和“无需调试即可启动(Ctrl-F5)”吗?

This is a little more complex then simply pressing F5. 与仅按F5相比,这要复杂一些。 You can add pre and post build event command in the project properties (right click project -> properties -> build events). 您可以在项目属性中添加构建事件之前和之后的命令(右键单击项目->属性->构建事件)。

While I have never done this you could build out a .BAT file as you suggested that runs all the commands and have it executed by changing the build events as shown above. 尽管我从未这样做过,但是您可以按照建议的方式构建一个.BAT文件,该文件可以运行所有命令并通过更改构建事件来执行该文件,如上所示。

However, you're best keeping your frontend outside of Visual Studio and away from the solution. 但是,最好将前端保持在Visual Studio之外并且远离解决方案。 It gets messy fast. 快速变得混乱。 IMO. 海事组织。

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

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