The Angular CLI tool is a great utility for getting an Angular project off the ground and running.

 

The downside from a .NET developers point of view is that if you are developing the backend of your system using .NET Core with Visual Studio you might have ended up with two separate projects. However, with a bit of tweaking it is possible the get the Angular CLI project to work inside the .NET Core. Here’s how:

Step 1

Create a .NET Core 2.0 Web API Project in Visual Studio.

Step 2

Use the Angular CLI to create a separate project with the “ng new” command

(Instructions for the Angular CLI can be found here)

Wait for it to finish installing all the required packages.

Step 3

Copy all the files and folders from the newly created CLI Angular project folder into the folder of the Core Project. You should end up with something like this:

Visual Studio should pick up the newly added files and folders (except for the node_modules folder) but if not, turn on the “Show all files” option and add them in.

Step 4

Open the .angular-cli.json file and change the outDir option to “wwwroot”