SPA AngularJS with ASP.NET MVC lose layout on refresh page

In this tutorial, I'll show you how to fix the lost page layout when refreshing your page in ASP.NET MVC using AngularJS. To fix SPA refresh page using routing with AngularJS, you should modify the configuration in the RouteConfig class as below.

As you can see, the template i'm using is an html file extension instead of returning from PartialView in ASP.NET MVC and AngularJS Page Refresh Problems have been solved. If your controller return View you get an error trying to load Angular more than once because it calls Index action in the Home controller again, you should return the PartialView but it will be losed layout when refreshing your page