Angular-cli: Has anyone integrated a angular-cli project with a .net core application?

Created on 5 Nov 2016  路  9Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS

Windows 10

Question

I have a requirement where I need the main application to be a .net core app but part of the application will be developed with Angular 2. So I was wondering if any of you ever tried to do this integration. I have been able to integrate using SystemJS (Using the Angular 2 Quick Start) but I would like to use the structure provided by the CLI scaffolding project. At the moment, my issue is to load the main.js into the .cshtml
Can anyone help me out please?

help wanted RFC / discussion / question

Most helpful comment

I am now using this setup here: https://dustinewers.com/angular-cli-with-net-core/

All 9 comments

Have you taken a look at the ASP.NET Core - Angular 2 yeoman generator? Even if you choose not to use the final generated output it may provide some guidance on project & file setup.

Since I wanted the application to use the prod builds with cache busting suffixes I pointed the CLI config to an empty .html file which then gets filled with the script tags as index.html in the dist folder. I then load and append that file to the .cshtml in the appropriate location through the MVC controller action and razor.

Its perhaps not the cleanest solution but it solved that problem for me.

I can't answer myself but flagged it for community help.

maybe this blog post can help you?
Angular2 CLI with ASP.NET Core application - tutorial

@tomeeraerts thanks for the article! I have been able to achieve what I was after using this tutorial as base idea.

@Daxaar This structure also helped me to understand a few things.

Thanks for the help guys.

Cool, glad to hear you got it sorted, and thanks for the wonderful community help!

I am now using this setup here: https://dustinewers.com/angular-cli-with-net-core/

I got one running with UseSpa and stuff - check out the project template for angular look in start.cs and try the UseSpa with the dir setting and so on - _or_ use routing with starts with /angular or similar + static files

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings