I use Visual Studio 2017 and have developed two Angular 2 applications. The first is pure Angular 2 with no backend code (Data comes from wcf services). The second is an Angul
One option is to scaffold the application using the Angular CLI and an ASP.NET Core project.
npm install --global @angular/cli
ng new my-app
Change the outDir
in the .angular-cli.json
file to point to your project's /wwwroot
directory
Configure your application as a static file server.
void ConfigureServices(...) {
app.AddMvc(); // Microsoft.AspNetCore.Mvc
}
void Configure(app) {
app.UseMvcWithDefaultRoute();
app.UseDefaultFiles(); // Microsoft.AspNetCore.StaticFiles
app.UseStaticFiles();
}
Right-click on the project and select Publish
Select either Azure App Service
or IIS/FTP
and follow the on-screen instructions
Here's a tutorial: https://medium.com/@levifuller/building-an-angular-application-with-asp-net-core-in-visual-studio-2017-visualized-f4b163830eaa