shaik irshad sharif shaik irshad sharif - 8 days ago 4
AngularJS Question

Refresh page in redirectTo using $routeprovider

As shown below, I'm trying to reload the whole page with home directory as target url. But only the control is getting loaded instead of reload.
How can I achieve page reload functionality in 'otherwise' instead of just loading a control?

myApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) {
$routeProvider.
when('/Admin/ConfigPanel', {
templateUrl: '/Admin/ConfigPanel/ManageRoles'
}).
otherwise({
redirectTo: '/Home/Index'
});

$locationProvider.html5Mode(true);
}]);

Answer

Add target="_self" inside your <a> link

<a href="/Admin/ConfigPanel/ManageRoles" target="_self">Manage Roles</a>