I have an existing Asp.Net Core 2 MVC app and want to add an angular front end view that gets data from the MVC Web API. Will this require Node.js? (Also if anyone has any tips on tutorials on how to integrate angular into an existing project it would be appreciated).
-
1Are you referring to angular (2.x+) or angularjs (1.x) here? Your question refers to Angular but uses the angularjs tag. These are entirely different frameworks. One of them optionally uses a package manager, which would involve node.js; the other is completely independent.Claies– Claies2018-03-26 15:41:40 +00:00Commented Mar 26, 2018 at 15:41
-
@Claies Thanks for the warning. I need it to be Angular2 !Daarwin– Daarwin2018-03-26 16:02:16 +00:00Commented Mar 26, 2018 at 16:02
-
ok, and are you using TypeScript to write your angular code?Claies– Claies2018-03-26 16:04:30 +00:00Commented Mar 26, 2018 at 16:04
-
That is the plan, even if it has not happened yet.Daarwin– Daarwin2018-03-26 16:07:36 +00:00Commented Mar 26, 2018 at 16:07
-
1well then that will absolutely require Node.js, since it's a critical piece of the workflow of compiling the TypeScript into JavaScript.Claies– Claies2018-03-26 16:09:48 +00:00Commented Mar 26, 2018 at 16:09
|
Show 1 more comment
1 Answer
Visual Studio 2017 Community (or better) provides templates for ASP.NET Core WebAPI and Angular combined.
You will need node.js for package managing. Visual Studio has a version included.
I would suggest you to completely seperate both. Use the angular-cli for the front-end. Helps you doing all the infrastructure stuff.
2 Comments
Daarwin
I have seen the template. I cant integrate it into an existing project. Ive tried the template and ideed it needs node.js. However i have read that angular doesnt need node.js to just act as the frontend. So im trying to see if i can get away without having to introduce unnescesary complexity into the existing project.
alsami
Yes, as I said, it is not using node.js as webserver to host the angular application it is using it as webserver for packaging managing (node package manager - npm)