I'm using Angular ngRoute
.
When I'm trying to route to another page, it is not redirecting in URL. It shows as http://localhost:58317/#!#%2Fstudents
myApp.js
var app = angular.module('MyApp', ['googlechart', 'ngRoute'])
app.controller('HomeCtrl', function ($scope) {
$scope.msg = "Hello Angular.....";
})
app.config(function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(false);
$locationProvider.hashPrefix("!");
$routeProvider.when("/home", {
templateUrl: '/Home/part1',
controller: 'routeDemoFirstController'
}).
when('/contact', {
templateUrl: '/Home/part2',
controller: 'routeDemoSecondController'
}).
when('/students', {
templateUrl: '/Home/part2',
controller: 'routeDemoSecondController'
})
})
Index.cshtml This is my .cshtml code Here i write anchor tag
<div class="row">
<div>
<a href="/#/home">Home</a>
<a href="#/contact">Courses</a>
<a href="#/students">Students</a>
</div>
<ng-view></ng-view>
</div>