2

I have an MVC project in an Area of a larger solution. I would like to add an Angular App inside that area and add it to my MVC project. This is not a .Net Core Mvc project. How would i tell my project to use webpackdevmiddleware? I.E.

app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions{
HotModuleReplacement = true
});

Since i would be adding the Mvc app in an area and my folder structure looks like so. enter image description here

Where should i run my ng new command? IE C:\Project\Areas\Mvc ng new AngularApp or how do i set the directory so that the app is created in my MVC folder?

would it be easier to just create an angular .net core app instead? Inside the areas folder?

3
  • Angular cli :thumbsdown: Commented Dec 7, 2017 at 22:51
  • 1
    Check this article, it might be of help Commented Dec 7, 2017 at 23:08
  • @cyberpirate92 that is helpful if you want to create a .netcore mvc app. I am looking to add Angular to an existing MVC5 app. Have you tried the .netcore cli method? All you do is dotnet new angular and it creates an app for you with everything. Commented Dec 13, 2017 at 15:16

1 Answer 1

4

If anyone is trying to figure out how to do this i found a guide that works HERE.

This particular example uses a gulp task to pull in the necessary node_modules and transpile your app into javascript. I am on the lookout at the moment for an example that does the same thing using webpack. Essentially you add a tsconfig.json, a package.json, a gulpfile.js, and then a tsconfig.js as well as your app files in typescript. This does not use the angular cli at all.

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

Comments

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.