2

So I have checked many websites, that now it's possible to use .NET Core with Angular 2. My question now is, what is the use of .NET core in these applications?

In the tutorials on the internet, they only mostly use Angular 2 and typescript, nothing from .NET core, except the Startup.cs file.

Per my understanding .NET Core would take are of all the requests (I'm still new in .NET core, so not sure) like JSON, OData, e.t.c. (validating, retrieving data afterwards, and so on). So it would be like a serer side language.

But still, something doesn't look correct to me, so it would be great, if someone could explain it in real-life scenario.

3
  • 5
    Angular = in browser. .NET Core = in server. Commented Sep 9, 2016 at 18:46
  • 1
    So basically, mostly I understood correct, that Angular 2 will be working on client-side and .NET core will be working in server, and checking data, connecting to database and so on and on. So Angular 2 will also replace .NET core views, and the structure will be that there will be .cs files from .NET core for doing necessary changes in server side and .ts and .html files from .Angular, which will render the webpage and do all necessary things in front-end. Is that correct? Commented Sep 9, 2016 at 18:49
  • 2
    You can use asp.net views in combination with angular. I have done so in the past to reduce copy/pasted code by making html helpers to emit common code used across the app. Nothing says that angular views have to be raw html files. If they come from the server, they can be parsed and processed. Commented Sep 9, 2016 at 18:50

2 Answers 2

5

Angular of any version is server platform agnostic. .NET Core has nothing to do with Angular, as it works on the server side, while Angular works on the client side. The two interact, across HTTP, sure, but it doesn't matter what's on the back end.

As Angular 2 has a wide range of client-side uses, it's probably strongest as a framework to use for single page applications (SPA). To that end, using ASP.NET Core on the back end makes sense if you use it to build out API endpoints. Core and previous versions of MVC/Web API all do this well.

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

Comments

1

You can use .net Core to create an API that Angular then uses. But .net is only one of many possible options.

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.