Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using angularjs and ASP.NET MVC

When using angularjs, I am serving up the home index page via ASP.NET MVC4. But I want this to be a SPA. For angularjs routing, does that mean I abandon partial server side views a la MVC and just work with html pages as my angularjs 'partial' views?

Anyone done this, and if so what approach did you take? Simple html pages with angularjs or some other solution?

like image 979
Nicros Avatar asked Feb 16 '23 23:02

Nicros


1 Answers

What Darin said is true.

Just to add to it, I'd suggest pairing Web Api with angularjs instead of standard MVC because it's a better fit. You don't need mvc partials (because they're server side partials and angularjs is client based).

So all your server stuff which would be json etc will be handled through ApiController actions. you could have your models etc still there like normal. But for your MVC views, it'll be just the one. All your angularjs SPA routes will be handled within angular.

like image 122
mnsr Avatar answered Feb 22 '23 01:02

mnsr