The solution depends on how you have configured your application and your server.
This solution assumes that you are building a SPA .
This means that for any main route of your application on the server (not a particular fragment of view) you are going to send the same thing that you send when you are requested
/Home/Index and on that page you have all your scripts and the scripts of angular loaded. On top of that you are using the module ngRoute or ui-router
Eg, you always send this
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport"/>
<link rel="stylesheet" href="/Content/css/style.css" />
You have to enable in HTM5 mode in $ locationProvider . In a
config of your application you write something like this (usually when you define your routes in the client)
// Habilitar modo html5
This effectively uses the browser History API instead of refreshing the entire page by what you just have to send data and fragments to build your application. This removes the hash ( # ) or hashbang ( #! ), if you have configured it that way, and updates the urls as if you were requesting them directly from the server.
This solution is for when NO you are building a SPA and your server sends you different pages in each request where you include angular only as DOM manipulator and not to define your route system.
/Home/Index sends you a% full% page with a controller
IndexController sends you a% full% page with a controller
This solution requires to discard the use of
<html> and use something like
$window.location.href = '/Home/Index';
This will effectively eliminate hashing or hashing since it only makes a full reload of the page when
Find links that have a
<a href="/Home/Index" target="_self">vinculo</a>
Find absolute links that go to another domain
Find links that begin with
$location and direct to a base different from the one declared in the document