简体   繁体   中英

How to run the angular application i.e developed by using Angular CLI in VS2017?

Am working ASP.NET Web Application with Angular 6. For this, I created a solution/project by taking an empty Web Application template in Visual Studio 2017. With the help of Angular CLI, I added the Angular files successfully to the ASP.NET Empty project and the project structure looks like:

Whenever I am trying to run the code from VS 2017, then the Application won't load main.ts file it only displays index.html content. But whenever I am trying to run the code from command prompt by entering the command as ng serve, then the application should launched successfully and load the main.ts file as well as display the UI/UX design.

So, can anyone suggest me what is the problem when I run the above angular application from VS2017 it won't load the main.ts file? But the same application will work from command prompt using ng serve command.

  • open cmd
  • change directory or folder using cd command like cd desktop to your project folder
  • put ng-serve on cmd and hit ' Enter '

OR

  • npm run ng serve use this command...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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