I am trying to make a rails api app with a angular frontend. I am using the angular routes. I want to know how to manage the hashtags. For example i want the url to be /dashboard instead of #/dashboard.
You need to add $locationProvider
in your router configurations.
app.config(['$routeProvider', '$locationProvider, function($routeProvider, $locationProvider) {
// enables html5 pushstate, so no # in url
$locationProvider.html5Mode(true);
$routeProvider
.when('/', {template: 'Homepage'})
.when('/about', {template: 'About'})
.otherwise({redirectTo: '/')
});
1 Like
but doing this disables the routing somehow and it hits the rails http request as it normally happens