I see how this is confusing, but true. You will need two separate projects. One of them will be the base .net backend server (REST), and the other will be Angular 2 spam. There will be a complete separation.
With AngularJS, you can simply insert the js file into razor mode and call it day. However, with Angular 2/4 and React, it is best to place each project in its own solution. It may seem silly at the beginning, but when you create your api, it can be easily justified by the future, as it can also be consumed by mobile applications, desktop applications, etc.
I know there is an Angular cli powershell dotnet spam wnet service for the .net kernel, but this is really a mess and actually outputs the wrong html, which can be harmful for SEO, etc. It is best, IMO, just use the Angular CLI in a separate project.
When it comes to production, you'll host the .net core api and Angular 2 projects separately.
Hope this helps.
source share