Angular Cli with ASP.NET MVC

You know how to implement Angular / Cli (Angular 4) with ASP NET MVC. I have done a lot of things and nothing, I cannot install it, if you know please help me.

+3


source to share


1 answer


This is difficult to achieve because it @angular/cli

depends heavily on the webpack. It's designed to be a lot more self-contained, at least in dev. So you have two options for you: enable partitioning, or integrate webpack dev server in ASP.NET as middleware.

If you take the first option, you just run them separately, and then when you deploy your application, copy the output html, css and javascript to your mvc directory /public

or /assets

site. (Typically this is part of your build pipeline.



Alternatively, if you can use the core aspnet (which I would recommend), you can use the JavascriptServices package with the main team and they will take care of the hard plumbing for you. It's pretty cool, you should check it out:

https://github.com/aspnet/JavaScriptServices http://blog.stevensanderson.com/2016/05/02/angular2-react-knockout-apps-on-aspnet-core/

+5


source







All Articles