Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set up asp.net angular 2 project using Angular-Cli with ASP.NET Core in Visual Studio 2015?

I set up angular 2 project using angular-cli and it works prefect with me. there is any way of add this project to asp.net core in visual studio

like image 328
kero Avatar asked Feb 06 '23 17:02

kero


2 Answers

I would move the Angular 2 project into the root of the ASP.NET Core project, and then move the contents of the Angular project's src folder into wwwroot - and rename any reference to the src folder.

This fits nicely together since wwwroot is for the client application, and Angular 2 is exactly that.

like image 176
MartinHN Avatar answered Feb 13 '23 05:02

MartinHN


2017-06-16 Now that the players in this scenario have matured, my favorite solution for setting this up is Rick Strahl's AlbumViewer application. He has used it as a sample for his numerous blog posts on ongoing development of both technologies. It is the cleanest and most adaptable solution so far. It uses the Angular cli tool (built on top of Webpack) to run all development and production workflow.

The development is done in a separate website project in the solution and the production build process copies the contents of the Angular dist folder to wwwroot for the final production build. Clean, simple and easy to follow.

This is the best answer I have seen to this question so far. Combine angular-cli with asp.net core

From the research I have done on the subject, the two are not making it easy to develop each other in the same environment.

like image 43
pthalacker Avatar answered Feb 13 '23 06:02

pthalacker