4

Do you know how to implement Angular/Cli (Angular 4) with ASP NET MVC. I made a lot of things and nothing, i can not install it, if you know please help me.

1 Answer 1

7

It's difficult to achieve, purely because the @angular/cli relies heavily on webpack. It's designed to be much more standalone, at dev time at least. So you have two options available to you: embrace the separation, or integrate webpack dev server into ASP.NET as middleware.

If you take the former option, you'll just start them up separately, and then when you deploy the application - will copy the output html, css and javascript into the /public or /assets directory of your mvc site. (Typically as a part of your build pipeline.

Alternatively, if you can use aspnet core (which I would recommend), you can use the JavascriptServices package by the core team and they 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/

Sign up to request clarification or add additional context in comments.

7 Comments

Thanks man. I really appreciate your answer and your time, so I will try to do it with the former way
Sure, let me see if I can, because I'm new in this xD, but thank you bro you are awesome
this is not a correct answer... you can totally do this, it just needs a bit of fiddling around... if i get time I'll post the answer as I have done this
I look forward to seeing it. :) If you reread what I said, I made it very clear that it was difficult to achieve - not that that it was impossible.
@EfrainPerez Have you managed to get it working? I would really like to know because I have the same problem
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.