Home Add Angular App to Existing MVC Project
Reply: 1

Add Angular App to Existing MVC Project

Leonardo Trimarchi
1#
Leonardo Trimarchi Published in 2017-12-07 22:48:43Z

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.

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?

Leonardo Trimarchi
2#
Leonardo Trimarchi Reply to 2017-12-13 15:11:18Z

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.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.306598 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO