It makes some sense. One thing does not eliminate the other. If it makes a lot of sense there is already questionable. Maybe it is more important to ASP.NET Webapi.
If your application actually has a single page, ASP.NET MVC will be quite useful, it will only generate one page. But this page will make numerous requests for information to the server, and the normal thing would be to answer them with the Webapi.
If you are using the .NET Core then you don’t even have to worry because the MVC and Webapi became one thing.
There’s a question about web technologies. NET.
There’s another question that compares the use of MVC with SPA.
And finally there’s a question that talks about the Webapi.
Note that these Angular2 routes and ASP.NET MVC routes have no direct link. One will run on the client (browser) and the other on the server. They are different purposes. One technology does not compete with the other, they are complementary.
Obviously, Angular2 routes will eventually lead to Webapi routes. Angular2 routes can work completely independently. If he can fix everything on the client, he doesn’t ask for anything on the server. When he needs something from the server a request will be made, then the Webapi routes go into action on the server to determine the controller suitable to call and provide what you need.
Understand that the use of Angular2 is to minimize access to the server, do not think of the two technologies as something that forms a single thing, are separate things. Even if you do it right and one day you want to trade Angular2 for React or other technology, it is to achieve without changing anything on the server. The server doesn’t even need to know you’re using Angular2.
It makes sense that I have a Controller in ASP.NET MVC to display only one view?
For the page I think doesn’t make much sense, makes having the controller for the webapi.
The use of ASP.NET MVC, when used together with angular, tends to be the "function" of the Webapi?
Exactly.
From an architectural point of view, it makes sense that I have ApiController
and Controller
within the same scope?
It does, if you use MVC, obviously it doesn’t if you don’t use MVC. If you use . NET Core you don’t have to worry about it.
Consider the use of Blazor.
A detail: Angular2 is not Angularjs.
– Jéf Bueno
I think there’s been a little mix-up. ASP NET will backend, so the backend routes will be the routes of the localhost/Rest/user/register services that will receive a json *(or xml or whatever you prefer) to make the persistence in the database. In the front the angular will have its route localhost/site/user/registration where will be displayed the html page with the cute form for the user to fill, with the angular javascript validating the form...
– Bartolomeu S. Gusella
But he meant about using ASP.NET MVC itself, not Webapi @Bartolomeus.Gusella
– Jéf Bueno