I have a site that i built on mvc and c#.net which works fine, now i am trying to build mobile site for the same using angular, so i want the urls to be without hash so i use the following code in my js file
var app = angular.module('mobilesite', ["ngRoute", "ngTouch", "mobile-angular-ui", "shoppinpal.mobile-menu"]);
app.config(['$httpProvider', function ($httpProvider) {
$httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest';
}]);
app.config(function ($routeProvider, $locationProvider) {
$routeProvider
.when('/Blog', {
templateUrl: "/Blog/Index"
});
//$locationProvider.html5Mode(true);
});
app.controller('maincontroller', function ($scope) {
$scope.Name = "Index Mobile";
});
app.controller('blogcontroller', function ($scope) {
$scope.Name = "Blog Mobile";
});
for example the url for blog will http://localhost/Blog and it works perfectly with no issues when clicked on the link.
But when i open a new browser and type the above url directly i get no layout loaded and only it displays {{Name}}. When i changed the javascript to use hash then everything works perfectly.
Am i missing something here, please help.